RSC  0.16.0
rsc::runtime Namespace Reference

Classes

class  InvalidMangledName
 This exception indicates the special case of an invalid argument where an invalid mangled name was passed to a function. More...
 
class  NoSuchObject
 This exception is thrown if a specified object does not exist. More...
 
class  Printable
 A base class that defines utility functions for printing objects to streams. More...
 
class  Properties
 Properties objects are basically glorified map<string, boost::any> objects. More...
 

Functions

std::string demangle (const char *mangledSymbol)
 This function takes the mangled name of a symbol and returns the demangled name of the symbol. More...
 
std::string demangle (const std::string &mangledSymbol)
 This function takes the mangled name of a symbol and returns the demangled name of the symbol. More...
 
ostream & operator<< (std::ostream &stream, const Printable &printable)
 Output operator on std::ostream for reference Printables. More...
 
ostream & operator<< (std::ostream &stream, const Printable *printable)
 Output operator on std::ostream for pointer Printables. More...
 
template<class Y >
std::ostream & operator<< (std::ostream &stream, boost::weak_ptr< Y > const &p)
 It seems boost::weak_ptr's do not have a stream operator. More...
 
template<typename T >
bool anyEqual (boost::any lhs, boost::any rhs)
 
Properties operator<< (const Properties &left, const Properties &right)
 Merge left and right. More...
 
template<typename Ch , typename Tr >
std::basic_ostream< Ch, Tr > & operator<< (std::basic_ostream< Ch, Tr > &stream, const std::pair< std::string, boost::any > &property)
 
template<typename Ch , typename Tr >
std::basic_ostream< Ch, Tr > & operator<< (std::basic_ostream< Ch, Tr > &stream, const Properties &properties)
 
std::string typeName (const std::type_info &type)
 Returns a (demangled) string representation of type. More...
 
template<typename T >
std::string typeName ()
 Returns a (demangled) string representation of the type of the template parameter. More...
 
template<typename T >
std::string typeName (const T &object)
 Returns a (demangled) string representation of the type of object. More...
 
template<typename T >
std::string typeString (const std::string &known_type_string, const std::string &unknown_type_string, const T &value)
 Returns one of two to strings depending on whether type T is known to be able to support stream output (using operator<<). More...
 
template<typename T >
std::string doTypeString (const std::string &known_type_string, const std::string &, const T &value, boost::true_type)
 
template<typename T >
std::string doTypeString (const std::string &, const std::string &unknown_type_string, const T &, boost::false_type)
 

Function Documentation

template<typename T >
bool rsc::runtime::anyEqual ( boost::any  lhs,
boost::any  rhs 
)

Definition at line 35 of file Properties.cpp.

RSC_EXPORT std::string rsc::runtime::demangle ( const char *  mangledSymbol)

This function takes the mangled name of a symbol and returns the demangled name of the symbol.

Parameters
mangled_symbolThe mangled name of the symbol.
Returns
The demangled name of the symbol.
Exceptions
runtime_error
InvalidMangledName
Author
Jan Moringen jmori.nosp@m.nge@.nosp@m.techf.nosp@m.ak.u.nosp@m.ni-bi.nosp@m.elef.nosp@m.eld.d.nosp@m.e

Definition at line 86 of file Demangle.cpp.

Referenced by demangle(), and typeName().

Here is the caller graph for this function:

RSC_EXPORT std::string rsc::runtime::demangle ( const std::string &  mangledSymbol)

This function takes the mangled name of a symbol and returns the demangled name of the symbol.

Parameters
mangled_symbolThe mangled name of the symbol.
Returns
The demangled name of the symbol.
Exceptions
runtime_error
InvalidMangledName
Author
Jan Moringen jmori.nosp@m.nge@.nosp@m.techf.nosp@m.ak.u.nosp@m.ni-bi.nosp@m.elef.nosp@m.eld.d.nosp@m.e

Definition at line 99 of file Demangle.cpp.

References demangle().

Here is the call graph for this function:

template<typename T >
std::string rsc::runtime::doTypeString ( const std::string &  known_type_string,
const std::string &  ,
const T &  value,
boost::true_type   
)

Definition at line 204 of file TypeStringTools.h.

template<typename T >
std::string rsc::runtime::doTypeString ( const std::string &  ,
const std::string &  unknown_type_string,
const T &  ,
boost::false_type   
)

Definition at line 210 of file TypeStringTools.h.

Referenced by typeString().

Here is the caller graph for this function:

RSC_EXPORT std::ostream & rsc::runtime::operator<< ( std::ostream &  stream,
const Printable printable 
)

Output operator on std::ostream for reference Printables.

Parameters
streamstream to print on
printablePrintable to print
Returns
the stream

Definition at line 56 of file Printable.cpp.

References rsc::runtime::Printable::print().

Here is the call graph for this function:

RSC_EXPORT std::ostream & rsc::runtime::operator<< ( std::ostream &  stream,
const Printable printable 
)

Output operator on std::ostream for pointer Printables.

Parameters
streamstream to print on
printablePrintable to print
Returns
the stream

Definition at line 61 of file Printable.cpp.

References rsc::runtime::Printable::print().

Here is the call graph for this function:

RSC_EXPORT Properties rsc::runtime::operator<< ( const Properties left,
const Properties right 
)

Merge left and right.

Values in right take precedence over values with identical keys in left.

Parameters
leftProperties with lower precedence.
rightProperties with higher precedence.
Returns
A new Properties object which contains the result of the merge.

Definition at line 98 of file Properties.cpp.

template<class Y >
std::ostream& rsc::runtime::operator<< ( std::ostream &  stream,
boost::weak_ptr< Y > const &  p 
)

It seems boost::weak_ptr's do not have a stream operator.

So provide one.

Parameters
streamstream to print on
ppointer to print
Returns
the stream that was printed on
Template Parameters
Ypointee type

Definition at line 120 of file Printable.h.

template<typename Ch , typename Tr >
std::basic_ostream<Ch, Tr>& rsc::runtime::operator<< ( std::basic_ostream< Ch, Tr > &  stream,
const std::pair< std::string, boost::any > &  property 
)
template<typename Ch , typename Tr >
std::basic_ostream< Ch, Tr > & rsc::runtime::operator<< ( std::basic_ostream< Ch, Tr > &  stream,
const Properties properties 
)

Definition at line 252 of file Properties.h.

References typeName().

Here is the call graph for this function:

RSC_EXPORT std::string rsc::runtime::typeName ( const std::type_info &  type)

Returns a (demangled) string representation of type.

Parameters
typeThe type that's name should be returned.
Returns
Demangled type name of type.
Exceptions
runtime_errorIf demangling the type's name fails.
Author
Jan Moringen jmori.nosp@m.nge@.nosp@m.techf.nosp@m.ak.u.nosp@m.ni-bi.nosp@m.elef.nosp@m.eld.d.nosp@m.e

Definition at line 34 of file TypeStringTools.cpp.

References demangle().

Referenced by rsc::patterns::Factory< Key, Interface >::createInst(), rsc::debug::DebugTools::exceptionInfo(), rsc::runtime::Properties::get(), rsc::runtime::Printable::getClassName(), operator<<(), std::operator<<(), rsc::patterns::operator<<(), and rsc::runtime::Properties::operator==().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
std::string rsc::runtime::typeName ( )

Returns a (demangled) string representation of the type of the template parameter.

Returns
Demangled type name of the type of the template parameter.
Exceptions
runtime_errorIf demangling the type's name fails.
Author
Jan Moringen jmori.nosp@m.nge@.nosp@m.techf.nosp@m.ak.u.nosp@m.ni-bi.nosp@m.elef.nosp@m.eld.d.nosp@m.e

Definition at line 194 of file TypeStringTools.h.

References demangle().

Here is the call graph for this function:

template<typename T >
std::string rsc::runtime::typeName ( const T &  object)

Returns a (demangled) string representation of the type of object.

Parameters
objectThe object, the stringified type of which should be returned.
Returns
Demangled type name of the type of object.
Exceptions
runtime_errorIf demangling the type's name fails.
Author
Jan Moringen jmori.nosp@m.nge@.nosp@m.techf.nosp@m.ak.u.nosp@m.ni-bi.nosp@m.elef.nosp@m.eld.d.nosp@m.e

Definition at line 199 of file TypeStringTools.h.

References demangle().

Here is the call graph for this function:

template<typename T >
std::string rsc::runtime::typeString ( const std::string &  known_type_string,
const std::string &  unknown_type_string,
const T &  value 
)

Returns one of two to strings depending on whether type T is known to be able to support stream output (using operator<<).

Parameters
known_type_stringThe string to be used if type T supports stream output. This string may contain %1% substrings that will be replaced by the result of writing value to a stream.
unknown_type_stringThe string to be used if type T does not support stream output. This string will be returned unmodified.
valueThe value that is to be embedded in known_type_string if that is possible.
Returns
- known_type_string - If type T supports stream output.
  • unknown_type_string - otherwise.
Exceptions
format_errorIf the format specified in known_type_string is invalid.
Note
As it cannot be deduced automatically whether a type T has operator<<(ostream,T) defined or not, work has to be done to support user-defined types here.
Author
Jan Moringen jmori.nosp@m.nge@.nosp@m.techf.nosp@m.ak.u.nosp@m.ni-bi.nosp@m.elef.nosp@m.eld.d.nosp@m.e

Definition at line 216 of file TypeStringTools.h.

References doTypeString().

Referenced by rsc::patterns::Factory< Key, Interface >::createInst(), rsc::patterns::Factory< Key, Interface >::register_(), and rsc::patterns::Factory< Key, Interface >::unregister().

Here is the call graph for this function:

Here is the caller graph for this function: