RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Workspace::Instance Class Reference

#include <workspace.h>

Inheritance diagram for Workspace::Instance:
IO::BlockSettings::ObjectDefaultGUIModelPerformanceMeasurement::Panel

Classes

struct  comment_t
 
struct  var_t
 

Public Member Functions

 Instance (std::string name, variable_t *variables, size_t size)
 
virtual ~Instance (void)
 
size_t getCount (IO::flags_t type) const
 
std::string getName (IO::flags_t type, size_t index) const
 
std::string getDescription (IO::flags_t type, size_t index) const
 
double getValue (IO::flags_t type, size_t index) const
 
std::string getValueString (IO::flags_t type, size_t index) const
 
void setValue (size_t index, double value)
 
void setComment (size_t index, std::string comment)
 
- Public Member Functions inherited from IO::Block
 Block (std::string name, channel_t *channels, size_t size)
 
virtual ~Block (void)
 
std::string getName (void) const
 
double input (size_t index) const
 
double output (size_t index) const
 
- Public Member Functions inherited from Settings::Object
 Object (void)
 
virtual ~Object (void)
 
ID getID (void) const
 
State save (void) const
 
void load (const State &)
 
void deferred (const State &)
 

Protected Member Functions

double * getData (IO::flags_t type, size_t index)
 
void setData (IO::flags_t type, size_t index, double *value)
 
- Protected Member Functions inherited from IO::Block
double & output (size_t index)
 
- Protected Member Functions inherited from Settings::Object
virtual void doLoad (const State &)
 
virtual void doDeferred (const State &)
 
virtual void doSave (State &) const
 

Private Attributes

std::vector< var_tparameter
 
std::vector< var_tstate
 
std::vector< var_tevent
 
std::vector< comment_tcomment
 

Friends

class Manager
 

Additional Inherited Members

- Public Types inherited from Settings::Object
typedef unsigned long ID
 
- Static Public Attributes inherited from Settings::Object
static const ID INVALID = 0
 

Detailed Description

An object that provides a standardized interface for accessing and manipulating both internal and external data.

See also
IO::Block

Definition at line 76 of file workspace.h.

Constructor & Destructor Documentation

Workspace::Instance::Instance(std::string name,
Workspace::variable_td,
size_t size 
)

The constructor needs to be provided with a specification of the variables that will be embedded in this workspace in the variables parameter. Fields that are not of type INPUT, OUTPUT, PARAMETER, or STATE will be safely ignored. Size should be the number of total fields in the variables parameter, regardless of type.

Parameters
nameThe name of the workspace.
variablesThe variable specification for this workspace.
sizeThe number of variables in the specification.
See also
Workspace::variable_t

Definition at line 67 of file workspace.cpp.

Workspace::Instance::~Instance(void )
virtual

Definition at line 128 of file workspace.cpp.

Member Function Documentation

size_t Workspace::Instance::getCount(IO::flags_t type)const
virtual

Get the number of variables of the specified type.

Parameters
typeThe type of variable to be probed.
Returns
The number of variables of the specified type.
See also
IO::Block::getCount()

Reimplemented from IO::Block.

Definition at line 136 of file workspace.cpp.

double * Workspace::Instance::getData(IO::flags_t type,
size_t index 
)
protected

Get the internal reference of the variable, for STATE types.

Parameters
typeThe variable's type.
indexThe variable's index.
Returns
The variable's storage location.
See also
Workspace::STATE

Definition at line 261 of file workspace.cpp.

std::string Workspace::Instance::getDescription(IO::flags_t type,
size_t index 
)const
virtual

Get the description of the specified variable.

Parameters
typeThe type of the variable.
indexThe variable's index.
Returns
The variable's description.
See also
IO::Block::getDescription()

Reimplemented from IO::Block.

Definition at line 168 of file workspace.cpp.

std::string Workspace::Instance::getName(IO::flags_t type,
size_t index 
)const
virtual

Get the name of the specified variable.

Parameters
typeThe type of the variable.
indexThe variable's index.
Returns
The variable's name.
See also
IO::Block::getName()

Reimplemented from IO::Block.

Definition at line 152 of file workspace.cpp.

double Workspace::Instance::getValue(IO::flags_t type,
size_t index 
)const
virtual

Get the value of the specified EVENT, PARAMETER or STATE variable.

Parameters
typeThe type of the specified variable.
indexThe variable's index.
Returns
The variable's value.
See also
IO::Block::getValue()
Workspace::setData()

Reimplemented from IO::Block.

Definition at line 182 of file workspace.cpp.

std::string Workspace::Instance::getValueString(IO::flags_t type,
size_t index 
)const

Get the value of the specified EVENT, PARAMETER, STATE, or COMMENT variable in string form.

Parameters
typeThe type of the specified variable.
indexThe variable's index.
Returns
The variable's value.
See also
Workspace::getValue()

Definition at line 204 of file workspace.cpp.

void Workspace::Instance::setComment(size_t index,
std::string comment 
)

Set the value of a COMMENT type variable

Parameters
indexThe variable's index.
valueThe variable's new value.
See also
Workspace::COMMENT

Definition at line 253 of file workspace.cpp.

void Workspace::Instance::setData(IO::flags_t type,
size_t index,
double * value 
)
protected

Set the internal reference of the variable, for STATE types.

Parameters
typeThe variable's type.
indexThe variable's index.
valueThe variable's storage location.
See also
Workspace::STATE

Definition at line 272 of file workspace.cpp.

void Workspace::Instance::setValue(size_t index,
double value 
)

Set the value of a PARAMETER type variable.

Parameters
indexThe variable's index.
valueThe variable's new value.
See also
Workspace::PARAMETER

Definition at line 231 of file workspace.cpp.

Friends And Related Function Documentation

friend class Manager
friend

Definition at line 79 of file workspace.h.

Member Data Documentation

std::vector<comment_t> Workspace::Instance::comment
private

Definition at line 214 of file workspace.h.

std::vector<var_t> Workspace::Instance::event
private

Definition at line 205 of file workspace.h.

std::vector<var_t> Workspace::Instance::parameter
private

Definition at line 203 of file workspace.h.

std::vector<var_t> Workspace::Instance::state
private

Definition at line 204 of file workspace.h.


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