Choreonoid  1.8
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
cnoid::MprVariable Class Reference

#include <MprVariable.h>

Inheritance diagram for cnoid::MprVariable:
cnoid::Referenced

Public Types

enum  TypeId { Int, Double, Bool, String }
 
enum  UpdateFlag { IdUpdate = 1 << 0, ValueUpdate = 1 << 1, NoteUpdate = 1 << 2 }
 
typedef stdx::variant< int, double, bool, std::string > Value
 

Public Member Functions

 MprVariable ()
 
 MprVariable (const GeneralId &id, Value value=0)
 
 MprVariable (const MprVariable &org)
 
MprVariableoperator= (const MprVariable &)=delete
 
const GeneralIdid () const
 
bool resetId (const GeneralId &id)
 
int valueType () const
 
bool changeValueType (TypeId type)
 
bool isInt () const
 
bool isDouble () const
 
bool isBool () const
 
bool isString () const
 
template<class T >
value () const
 
Value value () const
 
int intValue () const
 
double doubleValue () const
 
bool boolValue () const
 
const std::string & stringValue () const
 
bool setValue (int value)
 
bool setValue (double value)
 
bool setValue (bool value)
 
bool setValue (const std::string &value)
 
bool setValue (const Value &value)
 
bool toBool () const
 
std::string toString () const
 
const std::string & note () const
 
void setNote (const std::string &note)
 
MprVariableListownerVariableList () const
 
bool read (const Mapping &archive)
 
bool write (Mapping &archive) const
 
SignalProxy< void(int flags)> sigUpdated ()
 
void notifyUpdate (int flags=ValueUpdate)
 
- Public Member Functions inherited from cnoid::Referenced
virtual ~Referenced ()
 

Static Public Member Functions

static int valueType (const Value &value)
 
static int intValue (const Value &value)
 
static double doubleValue (const Value &value)
 
static bool boolValue (const Value &value)
 
static const std::string & stringValue (const Value &value)
 
static bool toBool (const Value &value)
 

Friends

class MprVariableList
 

Additional Inherited Members

- Protected Member Functions inherited from cnoid::Referenced
 Referenced ()
 
 Referenced (const Referenced &)
 
int refCount () const
 

Member Typedef Documentation

◆ Value

typedef stdx::variant<int, double, bool, std::string> cnoid::MprVariable::Value

Member Enumeration Documentation

◆ TypeId

Enumerator
Int 
Double 
Bool 
String 

◆ UpdateFlag

Enumerator
IdUpdate 
ValueUpdate 
NoteUpdate 

Constructor & Destructor Documentation

◆ MprVariable() [1/3]

MprVariable::MprVariable ( )

◆ MprVariable() [2/3]

MprVariable::MprVariable ( const GeneralId id,
Value  value = 0 
)

◆ MprVariable() [3/3]

MprVariable::MprVariable ( const MprVariable org)

Member Function Documentation

◆ boolValue() [1/2]

bool cnoid::MprVariable::boolValue ( ) const
inline

◆ boolValue() [2/2]

static bool cnoid::MprVariable::boolValue ( const Value value)
inlinestatic

◆ changeValueType()

bool MprVariable::changeValueType ( TypeId  type)

◆ doubleValue() [1/2]

double cnoid::MprVariable::doubleValue ( ) const
inline

◆ doubleValue() [2/2]

static double cnoid::MprVariable::doubleValue ( const Value value)
inlinestatic

◆ id()

const GeneralId& cnoid::MprVariable::id ( ) const
inline

◆ intValue() [1/2]

int cnoid::MprVariable::intValue ( ) const
inline

◆ intValue() [2/2]

static int cnoid::MprVariable::intValue ( const Value value)
inlinestatic

◆ isBool()

bool cnoid::MprVariable::isBool ( ) const
inline

◆ isDouble()

bool cnoid::MprVariable::isDouble ( ) const
inline

◆ isInt()

bool cnoid::MprVariable::isInt ( ) const
inline

◆ isString()

bool cnoid::MprVariable::isString ( ) const
inline

◆ note()

const std::string& cnoid::MprVariable::note ( ) const
inline

◆ notifyUpdate()

void MprVariable::notifyUpdate ( int  flags = ValueUpdate)

◆ operator=()

MprVariable& cnoid::MprVariable::operator= ( const MprVariable )
delete

◆ ownerVariableList()

MprVariableList * MprVariable::ownerVariableList ( ) const

◆ read()

bool MprVariable::read ( const Mapping archive)

◆ resetId()

bool MprVariable::resetId ( const GeneralId id)

◆ setNote()

void cnoid::MprVariable::setNote ( const std::string &  note)
inline

◆ setValue() [1/5]

bool MprVariable::setValue ( bool  value)

◆ setValue() [2/5]

bool MprVariable::setValue ( const std::string &  value)

◆ setValue() [3/5]

bool MprVariable::setValue ( const Value value)

◆ setValue() [4/5]

bool MprVariable::setValue ( double  value)

◆ setValue() [5/5]

bool MprVariable::setValue ( int  value)

◆ sigUpdated()

SignalProxy<void(int flags)> cnoid::MprVariable::sigUpdated ( )
inline

◆ stringValue() [1/2]

const std::string& cnoid::MprVariable::stringValue ( ) const
inline

◆ stringValue() [2/2]

static const std::string& cnoid::MprVariable::stringValue ( const Value value)
inlinestatic

◆ toBool() [1/2]

bool cnoid::MprVariable::toBool ( ) const
inline

◆ toBool() [2/2]

bool MprVariable::toBool ( const Value value)
static

◆ toString()

std::string MprVariable::toString ( ) const

◆ value() [1/2]

template<class T >
T cnoid::MprVariable::value ( ) const
inline

◆ value() [2/2]

Value cnoid::MprVariable::value ( ) const
inline

◆ valueType() [1/2]

int cnoid::MprVariable::valueType ( ) const
inline

◆ valueType() [2/2]

static int cnoid::MprVariable::valueType ( const Value value)
inlinestatic

◆ write()

bool MprVariable::write ( Mapping archive) const

Friends And Related Function Documentation

◆ MprVariableList

friend class MprVariableList
friend

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