Class Base#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Type#

  • public std::enable_shared_from_this< Base >

Derived Types#

Class Documentation#

class Base : public std::enable_shared_from_this<Base>#

Common base class used by most simulation objects.

Subclassed by Karana::Collision::ContactForceBase, Karana::Core::LockingBase, Karana::Dynamics::NodeDeformationProvider, Karana::Dynamics::TimeKeeper, Karana::Dynamics::TimedEvent, Karana::KUtils::H5Writer, Karana::Models::KModelContinuousStates, Karana::Models::KModelDiscreteStates, Karana::Models::KModelParams, Karana::Models::KModelScratch, Karana::Scene::AbstractStaticGeometry, Karana::Scene::PhongMaterial, Karana::Scene::PhysicalMaterial, Karana::Scene::Scene, Karana::Scene::SceneNode, Karana::Scene::Texture

Public Functions

Base(std::string_view name, const ks_ptr<BaseContainer> &container = nullptr)#

Base class constructor.

Parameters:
  • name – Name for the base class.

  • container – The container to add the Base too. If none is specified, the default singleton container will be used.

virtual ~Base()#

Destructor.

Base(const Base &other)#

Copy constructor.

Parameters:

otherBase class to copy.

Base &operator=(const Base &other) noexcept#

Copy assignment operator.

Parameters:

otherBase class to copy.

Returns:

A reference to this object

Base(Base &&other) noexcept#

Move constructor.

Parameters:

otherBase class to move.

Base &operator=(Base &&other) noexcept#

Move assignment operator.

Parameters:

otherBase class to move.

Returns:

A reference to this object

const id_t &id() const#

id of this object.

Returns:

id of this object.

virtual std::string_view typeString() const noexcept#

Returns the type string of Base.

Returns:

The type string.

virtual bool isFinalized() const#

Checks is the params for the object have been initialized.

Returns:

True if the params have set up.

std::string_view name() const noexcept#

Name of this object.

Returns:

Name of this object.

virtual std::string dumpString(std::string_view prefix = "", const DumpOptions *options = nullptr) const#

Return information about the object.

Parameters:
  • prefix – A string to use as prefix for each output line

  • options – Struct with options to tailor the output

Returns:

String with the information about the object.

void dump(std::string_view prefix = "", const DumpOptions *options = nullptr) const#

Print dumpString on std::cout.

Parameters:
  • prefix – A string to use as prefix for each output line

  • options – Struct with options to tailor the output

Protected Functions

virtual void _discard(ks_ptr<Base> &base)#

Discard the the object. Derived classes should implement this with the logic required to discard themselves if applicable.

Parameters:

base – - A pointer to the object to discard.

Protected Attributes

std::string _name#

The name of the Base.

struct DumpOptions#

A struct with options to tailor the content from a dumpString() call.

This struct can be sub-classed by specialized classes to add custom options.

Subclassed by Karana::Core::LockingBase::DumpOptions

Public Functions

DumpOptions() = default#
DumpOptions &operator=(const DumpOptions &p)#

Copy assignment operator.

Parameters:

p – The DumpOptions to copy from.

Returns:

A reference to this.

DumpOptions(const DumpOptions &p)#

Copy constructor.

Parameters:

p – The DumpOptions to copy from.

virtual ~DumpOptions()#

Destructor.

Public Members

bool type_string = true#

include the typeString info

bool id = false#

include the tree id

bool ref_count = false#

include the reference count

bool cache_deps = false#

Report cache dependency info.