DART 6.13.2
Loading...
Searching...
No Matches
dart::common Namespace Reference

Namespaces

namespace  detail
 
namespace  signal
 

Classes

struct  Alias_getStaticType
 
struct  Alias_getStaticType< T, ::std::integral_constant< bool, ::dart::common::detail::got_type< decltype(&T::getStaticType)>::value > >
 
struct  Alias_getType
 
struct  Alias_getType< T, ::std::integral_constant< bool, ::dart::common::detail::got_type< decltype(&T::getType)>::value > >
 
struct  AmbiguitySeed_getStaticType
 
struct  AmbiguitySeed_getType
 
class  Aspect
 
class  AspectWithStateAndVersionedProperties
 
class  CAllocator
 A stateless memory allocator (in release mode) that uses std::malloc and std::free for memory allocation and deallocation. More...
 
class  Castable
 A CRTP base class that provides an interface for easily casting to the derived types. More...
 
class  Cloneable
 Cloneable is a CRTP base class that provides an interface for easily creating data structures that are meant to be extended. More...
 
class  CloneableMap
 MapHolder is a templated wrapper class that is used to allow maps of Aspect::State and Aspect::Properties to be handled in a semantically palatable way. More...
 
class  CloneableVector
 The CloneableVector type wraps a std::vector of an Cloneable type allowing it to be handled by an CloneableMapHolder. More...
 
class  Composite
 Composite is a base class that should be virtually inherited by any class that wants to be able to manage Aspects. More...
 
class  CompositeJoiner
 Terminator for the variadic template. More...
 
class  CompositeJoiner< Base1 >
 Special case of only having 1 class: we do nothing but inherit it. More...
 
class  CompositeJoiner< Base1, Base2 >
 CompositeJoiner allows classes that inherit from various SpecializedForAspect types to be inherited by a single derived class. More...
 
class  CompositeJoiner< Base1, Base2, OtherBases... >
 This is the variadic version of the CompositeJoiner class which allows you to include arbitrarily many base classes in the joining. More...
 
class  CompositeTrackingAspect
 
class  Connection
 class Connection More...
 
class  EmbeddedPropertiesAspect
 This is the implementation of a standard embedded-properties Aspect. More...
 
class  EmbeddedStateAndPropertiesAspect
 This is the implementation of a standard combination of embedded-state and embedded-properties Aspect. More...
 
class  EmbeddedStateAspect
 This is the implementation of a standard embedded-state Aspect. More...
 
class  EmbedProperties
 Inherit this class to embed Properties into your Composite object. More...
 
class  EmbedPropertiesOnTopOf
 This is an alternative to EmbedProperties which allows your class to also inherit other Composite objects by listing them as the third (and later) template arguments. More...
 
class  EmbedState
 Inherit this class to embed a State into your Composite object. More...
 
class  EmbedStateAndProperties
 Inherit this class to embed both State and Properties into your Composite object. More...
 
class  EmbedStateAndPropertiesOnTopOf
 This is an alternative to EmbedStateAndProperties which allows your class to also inherit other Composite objects by listing them as the fourth (and later) template arguments. More...
 
class  EmbedStateOnTopOf
 This is an alternative to EmbedState which allows your class to also inherit other Composite objects by listing them as the third (and later) template arguments. More...
 
struct  Empty
 This is an empty structure which can be used as a template argument when a zero-cost placeholder is needed. More...
 
class  Factory
 Implementation of the Abstract Factory Pattern. More...
 
class  FactoryRegistrar
 Helper class to register a object creator function to the Singleton. More...
 
class  FreeListAllocator
 Most general heap memory allocator for allocating memory of various sizes. More...
 
struct  has_member_getStaticType
 
struct  has_member_getType
 
class  LocalResource
 
class  LocalResourceRetriever
 LocalResourceRetriever provides access to local resources specified by file:// URIs by wrapping the standard C and C++ file manipulation routines. More...
 
class  LockableReference
 LockableReference is a wrapper class of single or multiple Lockable object(s) to provide unified interface that guarantees deadlock-free locking and unlocking of the internal lockable(s). More...
 
class  MakeCloneable
 The MakeCloneable class is used to easily create an Cloneable (such as Node::State) which simply takes an existing class (Mixin) and creates an Cloneable that wraps it. More...
 
class  MemoryAllocator
 Base class for std::allocator compatible allocators. More...
 
class  MemoryAllocatorDebugger
 
class  MemoryManager
 A composite memory allocator that contains various memory allocators that are optimized for different use cases. More...
 
class  MultiLockableReference
 MultiLockableReference references multiple lockables. More...
 
class  NameManager
 class NameManager More...
 
class  Observer
 The Observer class should be inherited by any class that wants to respond in a customized way to the destruction of a Subject. More...
 
class  PoolAllocator
 Memory allocator optimized for allocating many objects of the same or similar sizes. More...
 
class  ProxyCloneable
 
class  ProxyStateAndPropertiesAspect
 
class  RequiresAspect
 RequiresAspect allows classes that inherit Composite to know which Aspects are required for their operation. More...
 
class  RequiresAspect< ReqAspect >
 
class  RequiresAspect< ReqAspect1, OtherReqAspects... >
 
class  Resource
 Resource provides file-like access to a resource loaded from URI. More...
 
class  ResourceRetriever
 ResourceRetriever provides methods for testing for the existance of and accessing the content of a resource specified by URI. More...
 
class  ScopedConnection
 class ScopedConnection More...
 
class  SharedLibrary
 SharedLibrary is a RAII object wrapping a shared library. More...
 
class  Signal
 
class  Signal< _Res(_ArgTypes...), Combiner >
 Signal implements a signal/slot mechanism. More...
 
class  Signal< void(_ArgTypes...)>
 Signal implements a signal/slot mechanism for the slots don't return a value. More...
 
class  SingleLockableReference
 This class references a single lockable. More...
 
class  Singleton
 Singleton template class. More...
 
class  SlotRegister
 SlotRegister can be used as a public member for connecting slots to a private Signal member. More...
 
class  SpecializedForAspect
 Declaration of the variadic template. More...
 
class  SpecializedForAspect< SpecAspect >
 SpecializedForAspect allows classes that inherit Composite to have constant-time access to a specific type of Aspect. More...
 
class  SpecializedForAspect< SpecAspect1, OtherSpecAspects... >
 This is the variadic version of the SpecializedForAspect class which allows you to include arbitrarily many specialized types in the specialization. More...
 
class  StlAllocator
 Wrapper class for MemoryAllocator to be compatible with std::allocator. More...
 
class  Stopwatch
 Simple stopwatch implementation. More...
 
class  sub_ptr
 sub_ptr is a pointer to a Subject. More...
 
class  Subject
 The Subject class is a base class for any object that wants to report when it gets destroyed. More...
 
class  Timer
 The implementation of Timer class. More...
 
struct  Uri
 The Uri struct provides URI parsing and merging functionality based on RFC 3986. More...
 
class  UriComponent
 
class  VersionCounter
 VersionCounter is an interface for objects that count their versions. More...
 
class  Virtual
 This class is used to have CRTP functions inherit their template parameters virtually instead of directly. More...
 

Typedefs

template<class DerivedT , typename StateDataT , class CompositeT = Composite, void(*)(DerivedT *) updateState = &detail::NoOp<DerivedT*>>
using AspectWithState = detail::AspectWithState< CompositeTrackingAspect< CompositeT >, DerivedT, StateDataT, CompositeT, updateState >
 
template<class DerivedT , typename PropertiesDataT , class CompositeT = Composite, void(*)(DerivedT *) updateProperties = &detail::NoOp<DerivedT*>>
using AspectWithVersionedProperties = detail::AspectWithVersionedProperties< CompositeTrackingAspect< CompositeT >, DerivedT, PropertiesDataT, CompositeT, updateProperties >
 
using error_code = ::std::error_code
 
using LocalResourceRetrieverPtr = std::shared_ptr< LocalResourceRetriever >
 
template<typename _Tp >
using aligned_vector = std::vector< _Tp, Eigen::aligned_allocator< _Tp > >
 
template<typename _Key , typename _Tp , typename _Compare = std::less<_Key>>
using aligned_map = std::map< _Key, _Tp, _Compare, Eigen::aligned_allocator< std::pair< const _Key, _Tp > > >
 
template<class T >
using optional = std::optional< T >
 
template<class CompositeT , typename StateT >
using ProxyStateAspect = detail::ProxyStateAspect< common::CompositeTrackingAspect< CompositeT >, CompositeT, StateT >
 
template<class CompositeT , typename PropertiesT >
using ProxyPropertiesAspect = detail::ProxyPropertiesAspect< common::CompositeTrackingAspect< CompositeT >, CompositeT, PropertiesT >
 
using ResourcePtr = std::shared_ptr< Resource >
 
using ResourceRetrieverPtr = std::shared_ptr< ResourceRetriever >
 
using StopwatchS = Stopwatch< std::chrono::seconds >
 
using StopwatchMS = Stopwatch< std::chrono::milliseconds >
 
using StopwatchUS = Stopwatch< std::chrono::microseconds >
 
using StopwatchNS = Stopwatch< std::chrono::nanoseconds >
 

Enumerations

enum  NoArgTag { NoArg }
 Used to tag arguments as blank for in variadic joiner classes such as common::CompositeJoiner and dynamics::NodeManagerJoiner. More...
 

Functions

template<typename ObjectType , class DataType , const DataType *(ObjectType::*)() const getData, typename ObjectMap = std::map<std::type_index, std::unique_ptr<ObjectType> >, typename DataMap = std::map<std::type_index, std::unique_ptr<DataType> >>
static void extractDataFromObjectTypeMap (DataMap &dataMap, const ObjectMap &objectMap)
 Type maps are std::map containers which map an object's Type Info to some instance or trait of that type.
 
template<typename ObjectType , class DataType , void(ObjectType::*)(const DataType &) setData, typename ObjectMap = std::map<std::type_index, std::unique_ptr<ObjectType> >, typename DataMap = std::map<std::type_index, std::unique_ptr<DataType> >>
static void setObjectsFromDataTypeMap (ObjectMap &objectMap, const DataMap &dataMap)
 Type maps are std::map containers which map an object's Type Info to some instance or trait of that type.
 
template<class T >
void createAspects (T *)
 Attach an arbitrary number of Aspects to the specified Composite type.
 
template<class T , class NextAspect , class... Aspects>
void createAspects (T *comp)
 
std::ostream & colorMsg (const std::string &_msg, int _color)
 
std::ostream & colorErr (const std::string &_msg, const std::string &_file, unsigned int _line, int _color)
 
template<typename S , typename... Args>
void trace (const S &format_str, Args &&... args)
 Logs for a trace message.
 
template<typename S , typename... Args>
void debug (const S &format_str, Args &&... args)
 Logs for a debug message.
 
template<typename S , typename... Args>
void info (const S &format_str, Args &&... args)
 Logs for a information message.
 
template<typename S , typename... Args>
void warn (const S &format_str, Args &&... args)
 Logs for a warning message.
 
template<typename S , typename... Args>
void error (const S &format_str, Args &&... args)
 Logs for a error message.
 
template<typename S , typename... Args>
void fatal (const S &format_str, Args &&... args)
 Logs for a fatal error message.
 
template<typename _Tp , typename... _Args>
std::shared_ptr< _Tp > make_aligned_shared (_Args &&... __args)
 
template<typename T , typename... Args>
std::unique_ptr< T > make_unique (Args &&... args)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const StlAllocator< T > &allocator)
 
template<typename UnitType , typename ClockType >
std::ostream & operator<< (std::ostream &os, const Stopwatch< UnitType, ClockType > &sw)
 
std::ostream & operator<< (std::ostream &os, const MemoryAllocator &allocator)
 
std::ostream & operator<< (std::ostream &os, const MemoryManager &memoryManager)
 
template<typename T >
static T getVectorObjectIfAvailable (std::size_t index, const std::vector< T > &vec)
 
void tic ()
 MATLAB like timer.
 
double toc (bool print=false)
 Returns the elapsed time in seconds since the last tic() call.
 
double tocS (bool print=false)
 Returns the elapsed time in seconds since the last tic() call.
 
double tocMS (bool print=false)
 Returns the elapsed time in milliseconds since the last tic() call.
 
double tocUS (bool print=false)
 Returns the elapsed time in microseconds since the last tic() call.
 
double tocNS (bool print=false)
 Returns the elapsed time in nanoseconds since the last tic() call.
 
std::string toUpper (std::string str)
 Converts string to upper cases.
 
void toUpperInPlace (std::string &str)
 Converts string to upper cases in place.
 
std::string toLower (std::string str)
 Converts string to lower cases.
 
void toLowerInPlace (std::string &str)
 Converts string to lower cases in place.
 
std::string trim (const std::string &str, const std::string &whitespaces=" \n\r\t")
 Trims both sides of string.
 
std::string trimLeft (const std::string &str, const std::string &whitespaces=" \n\r\t")
 Trims left side of string.
 
std::string trimRight (const std::string &str, const std::string &whitespaces=" \n\r\t")
 Trims right side of string.
 
std::vector< std::string > split (const std::string &str, const std::string &delimiters=" \n\r\t")
 Splits string given delimiters.
 

Variables

template<class DerivedT , typename StateDataT , typename PropertiesDataT , class CompositeT , void(*)(DerivedT *) updateState, void(*)(DerivedT *) updateProperties>
constexpr void(* AspectWithStateAndVersionedProperties )(DerivedT *)
 

Typedef Documentation

◆ aligned_map

template<typename _Key , typename _Tp , typename _Compare = std::less<_Key>>
using dart::common::aligned_map = typedef std::map< _Key, _Tp, _Compare, Eigen::aligned_allocator<std::pair<const _Key, _Tp> >>

◆ aligned_vector

template<typename _Tp >
using dart::common::aligned_vector = typedef std::vector<_Tp, Eigen::aligned_allocator<_Tp> >

◆ AspectWithState

template<class DerivedT , typename StateDataT , class CompositeT = Composite, void(*)(DerivedT *) updateState = &detail::NoOp<DerivedT*>>
using dart::common::AspectWithState = typedef detail::AspectWithState< CompositeTrackingAspect<CompositeT>, DerivedT, StateDataT, CompositeT, updateState>

◆ AspectWithVersionedProperties

template<class DerivedT , typename PropertiesDataT , class CompositeT = Composite, void(*)(DerivedT *) updateProperties = &detail::NoOp<DerivedT*>>
using dart::common::AspectWithVersionedProperties = typedef detail::AspectWithVersionedProperties< CompositeTrackingAspect<CompositeT>, DerivedT, PropertiesDataT, CompositeT, updateProperties>

◆ error_code

using dart::common::error_code = typedef ::std::error_code

◆ LocalResourceRetrieverPtr

◆ optional

template<class T >
using dart::common::optional = typedef std::optional<T>
Deprecated:
Use std::optional instead

◆ ProxyPropertiesAspect

template<class CompositeT , typename PropertiesT >
using dart::common::ProxyPropertiesAspect = typedef detail::ProxyPropertiesAspect< common::CompositeTrackingAspect<CompositeT>, CompositeT, PropertiesT>

◆ ProxyStateAspect

template<class CompositeT , typename StateT >
using dart::common::ProxyStateAspect = typedef detail::ProxyStateAspect< common::CompositeTrackingAspect<CompositeT>, CompositeT, StateT>

◆ ResourcePtr

using dart::common::ResourcePtr = typedef std::shared_ptr<Resource>

◆ ResourceRetrieverPtr

using dart::common::ResourceRetrieverPtr = typedef std::shared_ptr<ResourceRetriever>

◆ StopwatchMS

using dart::common::StopwatchMS = typedef Stopwatch<std::chrono::milliseconds>

◆ StopwatchNS

using dart::common::StopwatchNS = typedef Stopwatch<std::chrono::nanoseconds>

◆ StopwatchS

using dart::common::StopwatchS = typedef Stopwatch<std::chrono::seconds>

◆ StopwatchUS

using dart::common::StopwatchUS = typedef Stopwatch<std::chrono::microseconds>

Enumeration Type Documentation

◆ NoArgTag

Used to tag arguments as blank for in variadic joiner classes such as common::CompositeJoiner and dynamics::NodeManagerJoiner.

Enumerator
NoArg 

Function Documentation

◆ colorErr()

std::ostream & dart::common::colorErr ( const std::string &  _msg,
const std::string &  _file,
unsigned int  _line,
int  _color 
)

◆ colorMsg()

std::ostream & dart::common::colorMsg ( const std::string &  _msg,
int  _color 
)

◆ createAspects() [1/2]

template<class T >
void dart::common::createAspects ( T *  )

Attach an arbitrary number of Aspects to the specified Composite type.

◆ createAspects() [2/2]

template<class T , class NextAspect , class... Aspects>
void dart::common::createAspects ( T *  comp)

◆ debug()

template<typename S , typename... Args>
void dart::common::debug ( const S &  format_str,
Args &&...  args 
)

Logs for a debug message.

Logs for fine-grained information that is useful for debugging.

See also
info

◆ error()

template<typename S , typename... Args>
void dart::common::error ( const S &  format_str,
Args &&...  args 
)

Logs for a error message.

Logs for errors that might still allow the application to continue running, but the application might lead to unexpected behavior.

See also
info

◆ extractDataFromObjectTypeMap()

template<typename ObjectType , class DataType , const DataType *(ObjectType::*)() const getData, typename ObjectMap = std::map<std::type_index, std::unique_ptr<ObjectType> >, typename DataMap = std::map<std::type_index, std::unique_ptr<DataType> >>
static void dart::common::extractDataFromObjectTypeMap ( DataMap &  dataMap,
const ObjectMap &  objectMap 
)
static

Type maps are std::map containers which map an object's Type Info to some instance or trait of that type.

For example, an ObjectMap will map an object's type to a std::unique_ptr of an instance of that object. a StateMap will map an Object's type to a std::unique_ptr of a State instance for that Object. Type maps are used for the dart::common::Aspect class.

This function will move data from an Object instance into a container where the data is sorted by the Object type that it belongs to. If the DataMap that is being filled with data already has an instance of the data for a particular Object type, it will perform a copy instead of a clone to improve performance.

◆ fatal()

template<typename S , typename... Args>
void dart::common::fatal ( const S &  format_str,
Args &&...  args 
)

Logs for a fatal error message.

Logs for highly sever errors that will presumably lead the application to crash.

See also
info

◆ getVectorObjectIfAvailable()

template<typename T >
static T dart::common::getVectorObjectIfAvailable ( std::size_t  index,
const std::vector< T > &  vec 
)
static

◆ info()

template<typename S , typename... Args>
void dart::common::info ( const S &  format_str,
Args &&...  args 
)

Logs for a information message.

Logs for useful information from normal operations.

You can use a Python like formatting API as

dart::common::info("Hello {}!", "World"); // logged as "Hello World!"
void info(const S &format_str, Args &&... args)
Logs for a information message.
Definition Logging-impl.hpp:104

◆ make_aligned_shared()

template<typename _Tp , typename... _Args>
std::shared_ptr< _Tp > dart::common::make_aligned_shared ( _Args &&...  __args)

◆ make_unique()

template<typename T , typename... Args>
std::unique_ptr< T > dart::common::make_unique ( Args &&...  args)
Deprecated:
Deprecated in 6.9. Use std::make_unique instead.

◆ operator<<() [1/4]

std::ostream & dart::common::operator<< ( std::ostream &  os,
const MemoryAllocator allocator 
)

◆ operator<<() [2/4]

std::ostream & dart::common::operator<< ( std::ostream &  os,
const MemoryManager memoryManager 
)

◆ operator<<() [3/4]

template<typename T >
std::ostream & dart::common::operator<< ( std::ostream &  os,
const StlAllocator< T > &  allocator 
)

◆ operator<<() [4/4]

template<typename UnitType , typename ClockType >
std::ostream & dart::common::operator<< ( std::ostream &  os,
const Stopwatch< UnitType, ClockType > &  sw 
)

◆ setObjectsFromDataTypeMap()

template<typename ObjectType , class DataType , void(ObjectType::*)(const DataType &) setData, typename ObjectMap = std::map<std::type_index, std::unique_ptr<ObjectType> >, typename DataMap = std::map<std::type_index, std::unique_ptr<DataType> >>
static void dart::common::setObjectsFromDataTypeMap ( ObjectMap &  objectMap,
const DataMap &  dataMap 
)
static

Type maps are std::map containers which map an object's Type Info to some instance or trait of that type.

For example, an ObjectMap will map an object's type to a std::unique_ptr of an instance of that object. a StateMap will map an Object's type to a std::unique_ptr of a State instance for that Object. Type maps are used for the dart::common::Aspect class.

This function will take a type map of Data and pass its contents into the Objects contained in an ObjectMap for each corresponding Object type which is available.

◆ split()

std::vector< std::string > dart::common::split ( const std::string &  str,
const std::string &  delimiters 
)

Splits string given delimiters.

◆ tic()

void dart::common::tic ( )

MATLAB like timer.

tic();
auto elapsedS = toc(); // prints and returns the elapsed time
double toc(bool print)
Returns the elapsed time in seconds since the last tic() call.
Definition Stopwatch.cpp:48
void tic()
MATLAB like timer.
Definition Stopwatch.cpp:42

◆ toc()

double dart::common::toc ( bool  print)

Returns the elapsed time in seconds since the last tic() call.

◆ tocMS()

double dart::common::tocMS ( bool  print)

Returns the elapsed time in milliseconds since the last tic() call.

◆ tocNS()

double dart::common::tocNS ( bool  print)

Returns the elapsed time in nanoseconds since the last tic() call.

◆ tocS()

double dart::common::tocS ( bool  print)

Returns the elapsed time in seconds since the last tic() call.

◆ tocUS()

double dart::common::tocUS ( bool  print)

Returns the elapsed time in microseconds since the last tic() call.

◆ toLower()

std::string dart::common::toLower ( std::string  str)

Converts string to lower cases.

◆ toLowerInPlace()

void dart::common::toLowerInPlace ( std::string &  str)

Converts string to lower cases in place.

◆ toUpper()

std::string dart::common::toUpper ( std::string  str)

Converts string to upper cases.

◆ toUpperInPlace()

void dart::common::toUpperInPlace ( std::string &  str)

Converts string to upper cases in place.

◆ trace()

template<typename S , typename... Args>
void dart::common::trace ( const S &  format_str,
Args &&...  args 
)

Logs for a trace message.

Logs for the most fine-grained information than any other log levels.

See also
info

◆ trim()

std::string dart::common::trim ( const std::string &  str,
const std::string &  whitespaces 
)

Trims both sides of string.

◆ trimLeft()

std::string dart::common::trimLeft ( const std::string &  str,
const std::string &  whitespaces 
)

Trims left side of string.

◆ trimRight()

std::string dart::common::trimRight ( const std::string &  str,
const std::string &  whitespaces 
)

Trims right side of string.

◆ warn()

template<typename S , typename... Args>
void dart::common::warn ( const S &  format_str,
Args &&...  args 
)

Logs for a warning message.

Logs for warning information that is potentially harmful.

See also
info

Variable Documentation

◆ AspectWithStateAndVersionedProperties

template<class DerivedT , typename StateDataT , typename PropertiesDataT , class CompositeT , void(*)(DerivedT *) updateState, void(*)(DerivedT *) updateProperties>
constexpr void(* dart::common::AspectWithStateAndVersionedProperties)(DerivedT *) ( DerivedT *  )
constexpr