PeriDyno 1.2.1
Loading...
Searching...
No Matches
FBase Class Referenceabstract

#include <FBase.h>

Inheritance diagram for FBase:
Collaboration diagram for FBase:

Public Types

enum  FInputPolicy { One , Many }
 Field with a policy of FInputPolicy::Many is not allowed to be connected to FInputPolicy::One Field with policy of FInputPolicy::One can either be connected to a field of FInputPolicy::One or FInputPolicy::Many. More...
 

Public Member Functions

 FBase ()
 
 FBase (std::string name, std::string description, FieldTypeEnum type=FieldTypeEnum::Param, OBase *parent=nullptr)
 
virtual ~FBase ()
 
virtual uint size ()=0
 
virtual const std::string getTemplateName ()
 
virtual const std::string getClassName ()
 
std::string getObjectName ()
 
std::string getDescription ()
 
virtual DeviceType getDeviceType ()
 
void setObjectName (std::string name)
 
void setDescription (std::string description)
 
void setParent (OBase *owner)
 
OBase * parent ()
 
bool isDerived ()
 
bool isAutoDestroyable ()
 
void setAutoDestroy (bool autoDestroy)
 
void setDerived (bool derived)
 
uint sizeOfSinks ()
 
uint sizeOfValidSources ()
 
void requestValidSources (std::vector< FBase * > &src)
 
FBasegetSource ()
 
FBasegetTopField ()
 
std::vector< FBase * > & getSources ()
 
std::vector< FBase * > & getSinks ()
 
bool isModified ()
 
bool isActive ()
 A variable to control the visibility of the field.
 
void setActive (bool b)
 
void tick ()
 
void tack ()
 
bool isOptional ()
 
void tagOptional (bool optional)
 
float getMin ()
 
void setMin (float min_val)
 
float getMax ()
 
void setMax (float max_val)
 
void setRange (float min_val, float max_val)
 
FieldTypeEnum getFieldType ()
 
virtual bool connect (FBase *dst)=0
 
virtual bool disconnect (FBase *dst)
 
virtual FInputPolicy inputPolicy ()
 
virtual std::string serialize ()
 
virtual bool deserialize (const std::string &str)
 
FBasepromoteOuput ()
 Display a state field as an ouput field.
 
FBasepromoteInput ()
 Display a state field as an input field.
 
FBasedemoteOuput ()
 Hide a state field from outputs.
 
FBasedemoteInput ()
 Hide a state field from inputs.
 
virtual bool isEmpty ()=0
 
virtual void update ()
 
void attach (std::shared_ptr< FCallBackFunc > func)
 
void detach (std::shared_ptr< FCallBackFunc > func)
 

Protected Member Functions

void setSource (FBase *source)
 
bool addSink (FBase *f)
 
bool removeSink (FBase *f)
 
bool addSource (FBase *f)
 
bool removeSource (FBase *f)
 
bool connectField (FBase *dst)
 
bool disconnectField (FBase *dst)
 

Protected Attributes

FieldTypeEnum m_fType = FieldTypeEnum::Param
 

Private Attributes

std::string m_name
 
std::string m_description
 
bool m_optional = false
 
bool m_autoDestroyable = true
 
bool m_derived = false
 
bool mActive = true
 
float m_min = -FLT_MAX
 
float m_max = FLT_MAX
 
OBase * mOwner = nullptr
 
FBasemSingleSource = nullptr
 
std::vector< FBase * > mMultipleSources
 
std::vector< FBase * > mSinks
 
TimeStamp mTickTime
 
TimeStamp mTackTime
 
std::vector< std::shared_ptr< FCallBackFunc > > mCallbackFunc
 

Detailed Description

Definition at line 43 of file FBase.h.

Member Enumeration Documentation

◆ FInputPolicy

Field with a policy of FInputPolicy::Many is not allowed to be connected to FInputPolicy::One Field with policy of FInputPolicy::One can either be connected to a field of FInputPolicy::One or FInputPolicy::Many.

Enumerator
One 
Many 

Definition at line 54 of file FBase.h.

Constructor & Destructor Documentation

◆ FBase() [1/2]

dyno::FBase::FBase ( )
inline

Definition at line 46 of file FBase.h.

◆ FBase() [2/2]

dyno::FBase::FBase ( std::string name,
std::string description,
FieldTypeEnum type = FieldTypeEnum::Param,
OBase * parent = nullptr )

Definition at line 362 of file FBase.cpp.

◆ ~FBase()

dyno::FBase::~FBase ( )
virtual

Definition at line 372 of file FBase.cpp.

Member Function Documentation

◆ addSink()

bool dyno::FBase::addSink ( FBase * f)
protected

Definition at line 105 of file FBase.cpp.

◆ addSource()

bool dyno::FBase::addSource ( FBase * f)
protected

Definition at line 150 of file FBase.cpp.

◆ attach()

void dyno::FBase::attach ( std::shared_ptr< FCallBackFunc > func)

Definition at line 290 of file FBase.cpp.

◆ connect()

virtual bool dyno::FBase::connect ( FBase * dst)
pure virtual

◆ connectField()

bool dyno::FBase::connectField ( FBase * dst)
protected

Definition at line 230 of file FBase.cpp.

◆ demoteInput()

FBase * dyno::FBase::demoteInput ( )

Hide a state field from inputs.

Returns
state field

Definition at line 93 of file FBase.cpp.

◆ demoteOuput()

FBase * dyno::FBase::demoteOuput ( )

Hide a state field from outputs.

Returns
state field

Definition at line 81 of file FBase.cpp.

◆ deserialize()

virtual bool dyno::FBase::deserialize ( const std::string & str)
inlinevirtual

Definition at line 128 of file FBase.h.

◆ detach()

void dyno::FBase::detach ( std::shared_ptr< FCallBackFunc > func)

Definition at line 298 of file FBase.cpp.

◆ disconnect()

bool dyno::FBase::disconnect ( FBase * dst)
virtual

Definition at line 259 of file FBase.cpp.

◆ disconnectField()

bool dyno::FBase::disconnectField ( FBase * dst)
protected

Definition at line 254 of file FBase.cpp.

◆ getClassName()

virtual const std::string dyno::FBase::getClassName ( )
inlinevirtual

Definition at line 62 of file FBase.h.

◆ getDescription()

std::string dyno::FBase::getDescription ( )
inline

Definition at line 65 of file FBase.h.

◆ getDeviceType()

virtual DeviceType dyno::FBase::getDeviceType ( )
inlinevirtual

Definition at line 66 of file FBase.h.

◆ getFieldType()

FieldTypeEnum dyno::FBase::getFieldType ( )

Definition at line 388 of file FBase.cpp.

◆ getMax()

float dyno::FBase::getMax ( )
inline

Definition at line 114 of file FBase.h.

◆ getMin()

float dyno::FBase::getMin ( )
inline

Definition at line 111 of file FBase.h.

◆ getObjectName()

std::string dyno::FBase::getObjectName ( )
inline

Definition at line 64 of file FBase.h.

◆ getSinks()

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

Definition at line 91 of file FBase.h.

◆ getSource()

FBase * dyno::FBase::getSource ( )

Definition at line 52 of file FBase.cpp.

◆ getSources()

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

Definition at line 90 of file FBase.h.

◆ getTemplateName()

virtual const std::string dyno::FBase::getTemplateName ( )
inlinevirtual

Definition at line 61 of file FBase.h.

◆ getTopField()

FBase * dyno::FBase::getTopField ( )

Definition at line 264 of file FBase.cpp.

◆ inputPolicy()

virtual FInputPolicy dyno::FBase::inputPolicy ( )
inlinevirtual

Definition at line 125 of file FBase.h.

◆ isActive()

bool dyno::FBase::isActive ( )

A variable to control the visibility of the field.

Returns
true when the field is active, otherwise return false

Definition at line 330 of file FBase.cpp.

◆ isAutoDestroyable()

bool dyno::FBase::isAutoDestroyable ( )

Definition at line 187 of file FBase.cpp.

◆ isDerived()

bool dyno::FBase::isDerived ( )

Definition at line 182 of file FBase.cpp.

◆ isEmpty()

virtual bool dyno::FBase::isEmpty ( )
pure virtual

◆ isModified()

bool dyno::FBase::isModified ( )

Definition at line 311 of file FBase.cpp.

◆ isOptional()

bool dyno::FBase::isOptional ( )

Definition at line 352 of file FBase.cpp.

◆ parent()

OBase * dyno::FBase::parent ( )

Definition at line 41 of file FBase.cpp.

◆ promoteInput()

FBase * dyno::FBase::promoteInput ( )

Display a state field as an input field.

Returns
state field

Definition at line 69 of file FBase.cpp.

◆ promoteOuput()

FBase * dyno::FBase::promoteOuput ( )

Display a state field as an ouput field.

Returns
state field

Definition at line 57 of file FBase.cpp.

◆ removeSink()

bool dyno::FBase::removeSink ( FBase * f)
protected

Definition at line 127 of file FBase.cpp.

◆ removeSource()

bool dyno::FBase::removeSource ( FBase * f)
protected

Definition at line 166 of file FBase.cpp.

◆ requestValidSources()

void dyno::FBase::requestValidSources ( std::vector< FBase * > & src)

Definition at line 212 of file FBase.cpp.

◆ serialize()

virtual std::string dyno::FBase::serialize ( )
inlinevirtual

Definition at line 127 of file FBase.h.

◆ setActive()

void dyno::FBase::setActive ( bool b)

Definition at line 335 of file FBase.cpp.

◆ setAutoDestroy()

void dyno::FBase::setAutoDestroy ( bool autoDestroy)

Definition at line 192 of file FBase.cpp.

◆ setDerived()

void dyno::FBase::setDerived ( bool derived)

Definition at line 197 of file FBase.cpp.

◆ setDescription()

void dyno::FBase::setDescription ( std::string description)
inline

Definition at line 69 of file FBase.h.

◆ setMax()

void dyno::FBase::setMax ( float max_val)
inline

Definition at line 115 of file FBase.h.

◆ setMin()

void dyno::FBase::setMin ( float min_val)
inline

Definition at line 112 of file FBase.h.

◆ setObjectName()

void dyno::FBase::setObjectName ( std::string name)
inline

Definition at line 68 of file FBase.h.

◆ setParent()

void dyno::FBase::setParent ( OBase * owner)

Definition at line 36 of file FBase.cpp.

◆ setRange()

void dyno::FBase::setRange ( float min_val,
float max_val )
inline

Definition at line 117 of file FBase.h.

◆ setSource()

void dyno::FBase::setSource ( FBase * source)
protected

Definition at line 46 of file FBase.cpp.

◆ size()

virtual uint dyno::FBase::size ( )
pure virtual

◆ sizeOfSinks()

uint dyno::FBase::sizeOfSinks ( )

Definition at line 225 of file FBase.cpp.

◆ sizeOfValidSources()

uint dyno::FBase::sizeOfValidSources ( )

Definition at line 202 of file FBase.cpp.

◆ tack()

void dyno::FBase::tack ( )

Definition at line 347 of file FBase.cpp.

◆ tagOptional()

void dyno::FBase::tagOptional ( bool optional)

Definition at line 357 of file FBase.cpp.

◆ tick()

void dyno::FBase::tick ( )

Definition at line 340 of file FBase.cpp.

◆ update()

void dyno::FBase::update ( )
virtual

Definition at line 269 of file FBase.cpp.

Member Data Documentation

◆ m_autoDestroyable

bool dyno::FBase::m_autoDestroyable = true
private

Definition at line 185 of file FBase.h.

◆ m_derived

bool dyno::FBase::m_derived = false
private

Definition at line 186 of file FBase.h.

◆ m_description

std::string dyno::FBase::m_description
private

Definition at line 181 of file FBase.h.

◆ m_fType

FieldTypeEnum dyno::FBase::m_fType = FieldTypeEnum::Param
protected

Definition at line 177 of file FBase.h.

◆ m_max

float dyno::FBase::m_max = FLT_MAX
private

Definition at line 191 of file FBase.h.

◆ m_min

float dyno::FBase::m_min = -FLT_MAX
private

Definition at line 190 of file FBase.h.

◆ m_name

std::string dyno::FBase::m_name
private

Definition at line 180 of file FBase.h.

◆ m_optional

bool dyno::FBase::m_optional = false
private

Definition at line 183 of file FBase.h.

◆ mActive

bool dyno::FBase::mActive = true
private

Definition at line 188 of file FBase.h.

◆ mCallbackFunc

std::vector<std::shared_ptr<FCallBackFunc> > dyno::FBase::mCallbackFunc
private

Definition at line 206 of file FBase.h.

◆ mMultipleSources

std::vector<FBase*> dyno::FBase::mMultipleSources
private

Definition at line 199 of file FBase.h.

◆ mOwner

OBase* dyno::FBase::mOwner = nullptr
private

Definition at line 193 of file FBase.h.

◆ mSingleSource

FBase* dyno::FBase::mSingleSource = nullptr
private

If the input policy is FInputPolicy::One, use mSource, otherwise use mMultipleSources for data traversal.

Definition at line 198 of file FBase.h.

◆ mSinks

std::vector<FBase*> dyno::FBase::mSinks
private

Definition at line 201 of file FBase.h.

◆ mTackTime

TimeStamp dyno::FBase::mTackTime
private

Definition at line 204 of file FBase.h.

◆ mTickTime

TimeStamp dyno::FBase::mTickTime
private

Definition at line 203 of file FBase.h.


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