Class Base#
Defined in File Base.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Base Type#
public std::enable_shared_from_this< Base >
Derived Type#
public Karana::Core::BaseWithVars(Class BaseWithVars)
Class Documentation#
-
class Base : public std::enable_shared_from_this<Base>#
Base class used for Var and BaseWithVars. Most simulation objects will derive from BaseWithVars.
Subclassed by Karana::Core::BaseWithVars
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) noexcept#
Move assignment operator.
- Parameters:
other – Base class to move.
- Returns:
A reference to this object
-
virtual std::string_view typeString(bool brief = true) const noexcept#
Returns the type string of Base.
- Parameters:
brief – if true, return the short form of the class type name, else the full type name
- Returns:
The type string.
-
virtual bool isReady() 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
-
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.
-
DumpOptions() = default#
-
Base(std::string_view name, const ks_ptr<BaseContainer> &container = nullptr)#