PeriDyno 1.0.0
Loading...
Searching...
No Matches
dyno::OBase Class Reference

#include <OBase.h>

Inheritance diagram for dyno::OBase:
Collaboration diagram for dyno::OBase:

Public Types

typedef std::vector< FBase * > FieldVector
 
typedef std::map< FieldID, FBase * > FieldMap
 

Public Member Functions

 OBase ()
 
 ~OBase () override
 
virtual std::string caption ()
 Return the caption.
 
virtual bool captionVisible ()
 Whether to hide the caption in the GUI.
 
virtual std::string description ()
 Return a description for the node or module, override this function to support user-defined description.
 
virtual std::string getName ()
 
bool addField (FBase *data)
 Add a field to Base FieldID will be set to the name of Field by default.
 
bool addField (FieldID name, FBase *data)
 Add a field to Base.
 
bool addFieldAlias (FieldID name, FBase *data)
 
bool addFieldAlias (FieldID name, FBase *data, FieldMap &fieldAlias)
 
bool findField (FBase *data)
 Find a field by its pointer.
 
bool findFieldAlias (const FieldID name)
 Find a field by its name.
 
bool findFieldAlias (const FieldID name, FieldMap &fieldAlias)
 Find a field in fieldAlias by its name This function is typically called by other functions.
 
bool removeField (FBase *data)
 Remove a field by its pointer.
 
bool removeFieldAlias (const FieldID name)
 Remove a field by its name.
 
bool removeFieldAlias (const FieldID name, FieldMap &fieldAlias)
 
FBasegetField (const FieldID name)
 Return a field by its name.
 
std::vector< FBase * > & getAllFields ()
 
virtual bool attachField (FBase *field, std::string name, std::string desc, bool autoDestroy=true)
 Attach a field to Base.
 
template<typename T>
TgetField (FieldID name)
 
bool isAllFieldsReady ()
 Check the completeness of all required fields.
 
std::vector< FieldIDgetFieldAlias (FBase *data)
 
int getFieldAliasCount (FBase *data)
 
void setBlockCoord (float x, float y)
 
float bx ()
 
float by ()
 
bool findInputField (FBase *field)
 
bool addInputField (FBase *field)
 
bool removeInputField (FBase *field)
 
std::vector< FBase * > & getInputFields ()
 
bool findOutputField (FBase *field)
 
bool addOutputField (FBase *field)
 
bool addToOutput (FBase *field)
 
bool removeOutputField (FBase *field)
 
bool removeFromOutput (FBase *field)
 
std::vector< FBase * > & getOutputFields ()
 
bool findParameter (FBase *field)
 
bool addParameter (FBase *field)
 
bool removeParameter (FBase *field)
 
std::vector< FBase * > & getParameters ()
 
- Public Member Functions inherited from dyno::Object
 Object ()
 
virtual ~Object ()
 
ObjectId objectId ()
 

Protected Attributes

std::vector< FBase * > fields_input
 
std::vector< FBase * > fields_output
 
std::vector< FBase * > fields_param
 

Private Attributes

float block_x = 0.0f
 
float block_y = 0.0f
 
FieldVector m_field
 
FieldMap m_fieldAlias
 

Additional Inherited Members

- Static Public Member Functions inherited from dyno::Object
static bool registerClass (ClassInfo *ci)
 
static ObjectcreateObject (std::string name)
 
static std::map< std::string, ClassInfo * > * getClassMap ()
 
static ObjectId baseId ()
 Base Id.
 

Detailed Description

Definition at line 38 of file OBase.h.

Member Typedef Documentation

◆ FieldMap

typedef std::map<FieldID, FBase*> dyno::OBase::FieldMap

Definition at line 42 of file OBase.h.

◆ FieldVector

typedef std::vector<FBase*> dyno::OBase::FieldVector

Definition at line 41 of file OBase.h.

Constructor & Destructor Documentation

◆ OBase()

dyno::OBase::OBase ( )
inline

Definition at line 49 of file OBase.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~OBase()

dyno::OBase::~OBase ( )
override

Definition at line 9 of file OBase.cpp.

Member Function Documentation

◆ addField() [1/2]

bool dyno::OBase::addField ( FBase * data)

Add a field to Base FieldID will be set to the name of Field by default.

Definition at line 45 of file OBase.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addField() [2/2]

bool dyno::OBase::addField ( FieldID name,
FBase * data )

Add a field to Base.

Parameters
Fieldname
Fieldpointer

Definition at line 50 of file OBase.cpp.

Here is the call graph for this function:

◆ addFieldAlias() [1/2]

bool dyno::OBase::addFieldAlias ( FieldID name,
FBase * data )

Definition at line 69 of file OBase.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFieldAlias() [2/2]

bool dyno::OBase::addFieldAlias ( FieldID name,
FBase * data,
FieldMap & fieldAlias )

Definition at line 89 of file OBase.cpp.

Here is the call graph for this function:

◆ addInputField()

bool dyno::OBase::addInputField ( FBase * field)

Definition at line 276 of file OBase.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addOutputField()

bool dyno::OBase::addOutputField ( FBase * field)

Definition at line 319 of file OBase.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addParameter()

bool dyno::OBase::addParameter ( FBase * field)

Definition at line 390 of file OBase.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addToOutput()

bool dyno::OBase::addToOutput ( FBase * field)

Definition at line 333 of file OBase.cpp.

Here is the call graph for this function:

◆ attachField()

bool dyno::OBase::attachField ( FBase * field,
std::string name,
std::string desc,
bool autoDestroy = true )
virtual

Attach a field to Base.

Parameters
fieldField pointer
nameField name
descField description
autoDestroyThe field will be destroyed by Base if true, otherwise, the field should be explicitly destroyed by its creator.
Returns
Return false if the name conflicts with exists fields' names

Reimplemented in dyno::Module, dyno::Node, Module, and Node.

Definition at line 250 of file OBase.cpp.

Here is the call graph for this function:

◆ bx()

float dyno::OBase::bx ( )
inline

Definition at line 163 of file OBase.h.

◆ by()

float dyno::OBase::by ( )
inline

Definition at line 164 of file OBase.h.

◆ caption()

◆ captionVisible()

bool dyno::OBase::captionVisible ( )
virtual

Whether to hide the caption in the GUI.

Returns
the default value true, override this function support customized behaviors

Reimplemented in dyno::DataSource.

Definition at line 24 of file OBase.cpp.

◆ description()

std::string dyno::OBase::description ( )
virtual

Return a description for the node or module, override this function to support user-defined description.

Definition at line 29 of file OBase.cpp.

◆ findField()

bool dyno::OBase::findField ( FBase * data)

Find a field by its pointer.

Parameters
dataField pointer

Definition at line 109 of file OBase.cpp.

Here is the caller graph for this function:

◆ findFieldAlias() [1/2]

bool dyno::OBase::findFieldAlias ( const FieldID name)

Find a field by its name.

Parameters
nameField name

Definition at line 120 of file OBase.cpp.

Here is the caller graph for this function:

◆ findFieldAlias() [2/2]

bool dyno::OBase::findFieldAlias ( const FieldID name,
FieldMap & fieldAlias )

Find a field in fieldAlias by its name This function is typically called by other functions.

Parameters
nameField name
fieldAliasAll fields the searching is taken on

Definition at line 131 of file OBase.cpp.

◆ findInputField()

bool dyno::OBase::findInputField ( FBase * field)

Definition at line 265 of file OBase.cpp.

Here is the caller graph for this function:

◆ findOutputField()

bool dyno::OBase::findOutputField ( FBase * field)

Definition at line 308 of file OBase.cpp.

Here is the caller graph for this function:

◆ findParameter()

bool dyno::OBase::findParameter ( FBase * field)

Definition at line 379 of file OBase.cpp.

Here is the caller graph for this function:

◆ getAllFields()

std::vector< FBase * > & dyno::OBase::getAllFields ( )

Definition at line 202 of file OBase.cpp.

Here is the caller graph for this function:

◆ getField() [1/2]

FBase * dyno::OBase::getField ( const FieldID name)

Return a field by its name.

Definition at line 192 of file OBase.cpp.

Here is the caller graph for this function:

◆ getField() [2/2]

template<typename T>
T * dyno::OBase::getField ( FieldID name)
inline

Definition at line 142 of file OBase.h.

◆ getFieldAlias()

std::vector< std::string > dyno::OBase::getFieldAlias ( FBase * data)

Definition at line 222 of file OBase.cpp.

◆ getFieldAliasCount()

int dyno::OBase::getFieldAliasCount ( FBase * data)

Definition at line 236 of file OBase.cpp.

Here is the caller graph for this function:

◆ getInputFields()

std::vector< FBase * > & dyno::OBase::getInputFields ( )
inline

Definition at line 171 of file OBase.h.

Here is the caller graph for this function:

◆ getName()

std::string dyno::OBase::getName ( )
virtual

Reimplemented in dyno::Module, dyno::Node, Module, and Node.

Definition at line 40 of file OBase.cpp.

Here is the caller graph for this function:

◆ getOutputFields()

std::vector< FBase * > & dyno::OBase::getOutputFields ( )
inline

Definition at line 179 of file OBase.h.

Here is the caller graph for this function:

◆ getParameters()

std::vector< FBase * > & dyno::OBase::getParameters ( )
inline

Definition at line 185 of file OBase.h.

◆ isAllFieldsReady()

bool dyno::OBase::isAllFieldsReady ( )

Check the completeness of all required fields.

Definition at line 207 of file OBase.cpp.

◆ removeField()

bool dyno::OBase::removeField ( FBase * data)

Remove a field by its pointer.

Definition at line 142 of file OBase.cpp.

Here is the caller graph for this function:

◆ removeFieldAlias() [1/2]

bool dyno::OBase::removeFieldAlias ( const FieldID name)

Remove a field by its name.

Definition at line 168 of file OBase.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeFieldAlias() [2/2]

bool dyno::OBase::removeFieldAlias ( const FieldID name,
FieldMap & fieldAlias )

Definition at line 173 of file OBase.cpp.

Here is the call graph for this function:

◆ removeFromOutput()

bool dyno::OBase::removeFromOutput ( FBase * field)

Definition at line 363 of file OBase.cpp.

Here is the call graph for this function:

◆ removeInputField()

bool dyno::OBase::removeInputField ( FBase * field)

Definition at line 290 of file OBase.cpp.

Here is the call graph for this function:

◆ removeOutputField()

bool dyno::OBase::removeOutputField ( FBase * field)

Definition at line 345 of file OBase.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeParameter()

bool dyno::OBase::removeParameter ( FBase * field)

Definition at line 404 of file OBase.cpp.

Here is the call graph for this function:

◆ setBlockCoord()

void dyno::OBase::setBlockCoord ( float x,
float y )
inline

Definition at line 161 of file OBase.h.

Here is the caller graph for this function:

Member Data Documentation

◆ block_x

float dyno::OBase::block_x = 0.0f
private

Definition at line 202 of file OBase.h.

◆ block_y

float dyno::OBase::block_y = 0.0f
private

Definition at line 203 of file OBase.h.

◆ fields_input

std::vector<FBase*> dyno::OBase::fields_input
protected

Definition at line 209 of file OBase.h.

◆ fields_output

std::vector<FBase*> dyno::OBase::fields_output
protected

Definition at line 210 of file OBase.h.

◆ fields_param

std::vector<FBase*> dyno::OBase::fields_param
protected

Definition at line 211 of file OBase.h.

◆ m_field

FieldVector dyno::OBase::m_field
private

Definition at line 205 of file OBase.h.

◆ m_fieldAlias

FieldMap dyno::OBase::m_fieldAlias
private

Definition at line 206 of file OBase.h.


The documentation for this class was generated from the following files: