SurgSim::Framework Namespace Reference

## Classes

class | Accessible
| Mixin class for enabling a property system on OSS classes, the instance still needs to initialize properties in the constructor by using either addSetter, addGetter, addAccessors or the macro for each member variable that should be made accessible. More...
class | ApplicationData
| Enable searching for files in a given list of paths, give access to the current directory and wrap boost::filesystem functionality. More...
class | AssertionFailure
| An exception class thrown by SURGSIM_ASSERT() failures and SURGSIM_FAILURE(). More...
class | AssertMessage
| An internal message class used for assertion failures. More...
class | Asset
| This class is used to facilitate file loading. More...
class | Barrier
| Barrier class, synchronize a set of threads to wait at a common point, all threads will wait at Barrier::wait(val) until the number of threads calling wait is equal to the number given in the constructor. More...
class | BasicSceneElement
| Simple concrete implementation of a scene element that does not have any higher logic. More...
class | BasicThread
| Basic thread implementation, tries to maintain a constant rate, supplies startup an initialization, can be synchronized with other threads at startup after calling doRun() a thread be be set off and doInit() and doStartup() will be called in succession. More...
class | Behavior
| Behaviors perform actions. More...
class | BehaviorManager
| Manager to handle Behaviors. More...
class | Component
| Component is the main interface class to pass information to the system managers each will decide whether to handle a component of a given type or not. More...
class | ComponentManager
| Base Component Manager class. More...
class | FactoryBase
| CRTP Base class to implement Object Factory functionality on a base class, use this rather than writing your own functions to return the factory. More...
class | FactoryBase1
| CRTP Base class to implement Object Factory functionality on a base class, use this rather than writing your own functions to return the factory. More...
class | FileOutput
| Class to output logging information to a give file. More...
class | LockedContainer
| A simple thread-safe data container that can support multiple writers and readers. More...
class | Logger
| An object that can be used to control logging parameters, such as verbosity and log output destination. More...
class | LoggerManager
| Class to safely handle access to a group of loggers, manipulate the global logging threshold, and fetch logger(s) from a global pool. More...
class | LogMessage
| Specialization, handles flush on destruction. More...
class | LogMessageBase
| LogMessageBase is a base class to be used to customize messages for logging textual information can be put into a log message by using the << operator in general the message class will output all of its information when the destructor is being invoked, formats the incoming message to timestamp it and adds information about the logger. More...
class | LogOutput
| Virtual Base class to define an interface for outputting logging information. More...
class | NullOutput
class | ObjectFactory
| An object factory, once a class is registered with the factory it can be used to create instances of registered classes. More...
class | ObjectFactory1
| An object factory, once a class is registered with the factory it can be used to create instances of registered classes. More...
class | PoseComponent
| The PoseComponent holds a pose. More...
struct | Property
| Public struct to pair an accessible with its appropriate property. More...
class | Representation
| Representations are manifestations of a SceneElement. More...
class | ReuseFactory
| Factory for acquiring new or unused existing instances of class T to reduce repeated deallocation and reallocation of objects with short lifespans. More...
class | Runtime
| This class contains all the information about the runtime environment of the simulation, all the running threads, the state, while it is de facto a singleton it should be passed around if needed. More...
class | SamplingMetricBase
| SamplingMetricBase provides a base class to support metric development. More...
class | Scene
| Scene. Basic Container for SceneElements. More...
class | SceneElement
| SceneElement is the basic part of a scene, it is a container of components. More...
class | SharedInstance
| A utility class to manage a shared instance of an object. More...
class | StreamOutput
| Class to output logging information to a stream that can be passed into the constructor of the class. More...
class | ThreadPool
| A thread pool for completing heterogenous tasks. More...
class | Timer
| Timer class, measures execution times. More...
class | TransferPropertiesBehavior
| Behavior to copy properties between instances of Accessible. More...

## Typedefs

typedef boost::chrono::high_resolution_clock | Clock
| Wraps around the actual clock we are using. More...

## Enumerations

enum | { MANAGER_TYPE_NONE = -1, MANAGER_TYPE_BEHAVIOR, MANAGER_TYPE_GRAPHICS, MANAGER_TYPE_INPUT, MANAGER_TYPE_PHYSICS, MANAGER_TYPE_COUNT }
| Fixed List of enums for the available manager types, do not explicitly assign values, MANAGER_TYPE_COUNT is used to determine the number of actual manager types. More...
enum | LogLevel { LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_WARNING, LOG_LEVEL_SEVERE, LOG_LEVEL_CRITICAL }
| Logging levels. More...

## Functions

template<>
SurgSim::Math::Matrix44f | convert (boost::any val)
| Specialization for convert<T>() to correctly cast Matrix44d to Matrix44f, will throw if the val is not casteable to Matrix44[fd]. More...
template<>
std::string | convert (boost::any val)
| Specialization for convert<T>() to correctly cast const char* to std::string. More...
template<class T >
T | convert (boost::any val)
| Wrap boost::any_cast to use in std::bind, for some reason it does not work by itself. More...
template<class C , class D >
void | sleep_until (const boost::chrono::time_point< C, D > &time)
| A more accurate sleep_until that accounts for scheduler errors. More...
template<class Target , class Source >
std::shared_ptr< Target > | checkAndConvert (std::shared_ptr< Source > incoming, const std::string &expectedTypeName)
| The function tries to convert the Source type to the Target type it will throw if Target is not a subclass of Source. More...
bool | tryLoadNode (const std::string &fileName, YAML::Node *node)
| Perform a YAML load operation. More...
template<>
std::shared_ptr< SurgSim::Graphics::OsgTexture2d > | convert (boost::any val)
| Template specialization for the convert<> function used in accessible, this one can convert an incoming SurgSim::Graphics::Texture to an outgoing OsgTexture2d. More...

## Typedef Documentation

## Clock

typedef boost::chrono::high_resolution_clock SurgSim::Framework::Clock

Wraps around the actual clock we are using.

## Enumeration Type Documentation

## anonymous enum

anonymous enum

Fixed List of enums for the available manager types, do not explicitly assign values, MANAGER_TYPE_COUNT is used to determine the number of actual manager types.

Enumerator
MANAGER_TYPE_NONE |
MANAGER_TYPE_BEHAVIOR |
MANAGER_TYPE_GRAPHICS |
MANAGER_TYPE_INPUT |
MANAGER_TYPE_PHYSICS |
MANAGER_TYPE_COUNT |

## Function Documentation

## checkAndConvert()

template<class Target , class Source >

std::shared_ptr< Target > SurgSim::Framework::checkAndConvert | ( | std::shared_ptr< Source > | incoming,
|  | const std::string & | expectedTypeName
| ) |  |

The function tries to convert the Source type to the Target type it will throw if Target is not a subclass of Source.

Template Parameters

  Target | type that is used as the target type for the conversion, can usually be deduced
  Source | type that is the type of the incoming parameter, target needs to be a subclass of Source for the function to succeed

Parameters

  incoming | pointer to an instance of Source that is supposed to be converted to a pointer to Target
  expectedTypeName | a name to be used in the error message if the conversion fails, use the full namespace name of Source here.

Exceptions

  if |

Returns
  pointer of type Target if Target is a subclass of Source, throws otherwise.

## convert() [1/4]

template<>

std::shared_ptr< SurgSim::Graphics::OsgTexture2d > SurgSim::Framework::convert | ( | boost::any | val | ) |

Template specialization for the convert<> function used in accessible, this one can convert an incoming SurgSim::Graphics::Texture to an outgoing OsgTexture2d.

Template specialization for the convert<> function used in accessible, this one can convert an incoming SurgSim::Graphics::Texture to an outgoing OsgTexture2d.

Wrap boost::any_cast to use in std::bind, for some reason it does not work by itself.

This is necessary as we need Matrix44f as outputs in some cases but all our Matrices are Matrix44d. This lets the user define a property that does a type conversion, without having to implement an accessor.

Parameters

  val | The value to be converted, should be a Matrix44[df].

Returns
  A matrix val converted to Matrix44f.

Template specialization for the convert<> function used in accessible, this one can convert an incoming SurgSim::Graphics::Texture to an outgoing OsgTexture2d.

Wrap boost::any_cast to use in std::bind, for some reason it does not work by itself.

Parameters

  val | The value to be converted, should be a const char*

Returns
  A std::string

## convert() [2/4]

template<class T >

T SurgSim::Framework::convert | ( | boost::any | val | ) |

Wrap boost::any_cast to use in std::bind, for some reason it does not work by itself.

This function will throw an exception if the cast does not work, this usually means that the types do not match up at all.

Template Parameters

  T | target type for conversion.

Parameters

  val | The value to be converted.

Returns
  An object converted from boost::any to T, will throw an exception if the conversion fails

Wrap boost::any_cast to use in std::bind, for some reason it does not work by itself.

This is necessary as we need Matrix44f as outputs in some cases but all our Matrices are Matrix44d. This lets the user define a property that does a type conversion, without having to implement an accessor.

Parameters

  val | The value to be converted, should be a Matrix44[df].

Returns
  A matrix val converted to Matrix44f.

Wrap boost::any_cast to use in std::bind, for some reason it does not work by itself.

Parameters

  val | The value to be converted, should be a const char*

Returns
  A std::string

## convert() [3/4]

template<>

SurgSim::Math::Matrix44f SurgSim::Framework::convert | ( | boost::any | val | ) |

Specialization for convert<T>() to correctly cast Matrix44d to Matrix44f, will throw if the val is not casteable to Matrix44[fd].

Template specialization for the convert<> function used in accessible, this one can convert an incoming SurgSim::Graphics::Texture to an outgoing OsgTexture2d.

Wrap boost::any_cast to use in std::bind, for some reason it does not work by itself.

This is necessary as we need Matrix44f as outputs in some cases but all our Matrices are Matrix44d. This lets the user define a property that does a type conversion, without having to implement an accessor.

Parameters

  val | The value to be converted, should be a Matrix44[df].

Returns
  A matrix val converted to Matrix44f.

## convert() [4/4]

template<>

std::string SurgSim::Framework::convert | ( | boost::any | val | ) |

Specialization for convert<T>() to correctly cast const char* to std::string.

Template specialization for the convert<> function used in accessible, this one can convert an incoming SurgSim::Graphics::Texture to an outgoing OsgTexture2d.

Wrap boost::any_cast to use in std::bind, for some reason it does not work by itself.

Parameters

  val | The value to be converted, should be a const char*

Returns
  A std::string

## sleep_until()

template<class C , class D >

void SurgSim::Framework::sleep_until | ( | const boost::chrono::time_point< C, D > & | time | ) |

A more accurate sleep_until that accounts for scheduler errors.

Template Parameters

  C | Clock type
  D | Duration type

Parameters

  time | The time point in absolute time to sleep until

## tryLoadNode()

bool SurgSim::Framework::tryLoadNode | ( | const std::string & | fileName,
|  | YAML::Node * | node
| ) |  |

Perform a YAML load operation.

Parameters

  | fileName | the filename of the scene to be loaded, needs to be found
  [out] | node | pointer to the nodes structure to receive the newly loaded nodes

Returns
  true if the loading succeeded