Class Base#
Defined in File Base.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Base Type#
public std::enable_shared_from_this< Base >
Derived Types#
public Karana::Collision::ContactForceBase(Class ContactForceBase)public Karana::Core::LockingBase(Class LockingBase)public Karana::Dynamics::NodeDeformationProvider(Class NodeDeformationProvider)public Karana::Dynamics::TimeKeeper(Class TimeKeeper)public Karana::Dynamics::TimedEvent(Class TimedEvent)public Karana::Frame::Frame(Class Frame)public Karana::KUtils::H5Writer(Class H5Writer)public Karana::Models::KModelContinuousStates(Class KModelContinuousStates)public Karana::Models::KModelDiscreteStates(Class KModelDiscreteStates)public Karana::Models::KModelParams(Class KModelParams)public Karana::Models::KModelScratch(Class KModelScratch)public Karana::Scene::AbstractStaticGeometry(Class AbstractStaticGeometry)public Karana::Scene::PhongMaterial(Class PhongMaterial)public Karana::Scene::PhysicalMaterial(Class PhysicalMaterial)public Karana::Scene::Scene(Class Scene)public Karana::Scene::SceneNode(Class SceneNode)public Karana::Scene::Texture(Class Texture)
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::Frame::Frame, 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 &operator=(const Base &other) noexcept#
Copy assignment operator.
- Parameters:
other – Base class to copy.
- Returns:
A reference to this object
-
Base &operator=(Base &&other)#
Move assignment operator.
- Parameters:
other – Base class to move.
- Returns:
A reference to this object
-
virtual const std::string &typeString() const noexcept#
Returns the type string of Base.
- Returns:
The type string.
-
inline virtual bool isFinalized() const#
Checks is the params for the object have been initialized.
- Returns:
True if the params have set up.
-
bool isZombie()#
Returns true if this object is a zombie, false otherwise. Note, only things derived from LockingBase can actually become zobmies.
- Returns:
True if object is a zombie, false otherwise.
-
ks_ptr<Base> getPtr()#
Get a shared_ptr to self, enabled by the std::enabled_shared_from_this pattern.
- Returns:
Shared pointer to this.
-
ks_ptr<const Base> getPtr() const#
Get a shared_ptr to self, enabled by the std::enabled_shared_from_this pattern.
- Returns:
Const shared pointer to this.
-
const std::string &name() const noexcept#
Name of this object.
- Returns:
Name of this object.
-
virtual std::string dumpString(const std::string &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.
-
inline void dump(const std::string &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
Protected Attributes
-
bool _zombie = false#
Indicates whether the object is in a zombie state.
-
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#
-
inline dumpOptions &operator=(const dumpOptions &p)#
Copy assignment operator.
- Parameters:
p – The dumpOptions to copy from.
- Returns:
A reference to this.
-
inline dumpOptions(const dumpOptions &p)#
Copy constructor.
- Parameters:
p – The dumpOptions to copy from.
-
inline virtual ~dumpOptions()#
Destructor.
-
dumpOptions() = default#
-
Base(std::string_view name, const ks_ptr<BaseContainer> &container = nullptr)#