Orocos Real-Time Toolkit  2.8.3
Public Types | Static Public Member Functions | List of all members
RTT::corba::AnyConversion< Type > Struct Template Reference

This class converts a given application-specific type to a CORBA::Any object and vice versa. More...

#include <rtt/transports/corba/CorbaConversion.hpp>

Public Types

typedef CORBA::Any CorbaType
 corba type More...
 
typedef Type StdType
 C++ type. More...
 
typedef RTT::corba::CAnySequence sequence
 sequence of corba type (used to convert stl container) More...
 

Static Public Member Functions

static bool toStdType (StdType &tp, const CorbaType &cb)
 Updates tp with the contents of cb. More...
 
static bool toCorbaType (CorbaType &cb, const StdType &tp)
 Updates cb with the contents of tp. More...
 
static bool update (const CORBA::Any &any, StdType tp)
 Updates tp with the contents of any. More...
 
static CORBA::Any_ptr createAny (StdType tp)
 Creates an CORBA::Any object out of a C++/IDL type. More...
 
static bool updateAny (StdType tp, CORBA::Any &any)
 Updates an CORBA::Any object from of a C++/IDL type. More...
 

Detailed Description

template<class Type>
struct RTT::corba::AnyConversion< Type >

This class converts a given application-specific type to a CORBA::Any object and vice versa.

This class works with 'template specialisation'. To create your own any conversion, specialise this class for your application's C++ or IDL type. Also, your specialisation must be in the RTT namespace in order to be found by the CORBA-enabled classes such as Property or the TaskContext.

Parameters
Typeis the Standard C++ or IDL type which is used throughout your application.

Definition at line 81 of file CorbaConversion.hpp.

Member Typedef Documentation

template<class Type>
typedef CORBA::Any RTT::corba::AnyConversion< Type >::CorbaType

corba type

Definition at line 86 of file CorbaConversion.hpp.

template<class Type>
typedef RTT::corba::CAnySequence RTT::corba::AnyConversion< Type >::sequence

sequence of corba type (used to convert stl container)

Definition at line 94 of file CorbaConversion.hpp.

template<class Type>
typedef Type RTT::corba::AnyConversion< Type >::StdType

C++ type.

Definition at line 90 of file CorbaConversion.hpp.

Member Function Documentation

template<class Type>
static CORBA::Any_ptr RTT::corba::AnyConversion< Type >::createAny ( StdType  tp)
inlinestatic

Creates an CORBA::Any object out of a C++/IDL type.

Parameters
tpThe value to convert to an Any.
Returns
An Any object which contains tp or an empty Any object if the conversion was not possible.

Definition at line 138 of file CorbaConversion.hpp.

References RTT::Logger::endl(), RTT::Logger::Error, RTT::internal::DataSourceTypeInfo< T >::getType(), and RTT::Logger::log().

Referenced by RTT::corba::CorbaTemplateProtocol< T >::createAny(), and RTT::corba::AnyConversion< RTT::TaskContext * >::updateAny().

template<class Type>
static bool RTT::corba::AnyConversion< Type >::toCorbaType ( CorbaType cb,
const StdType tp 
)
inlinestatic
template<class Type>
static bool RTT::corba::AnyConversion< Type >::toStdType ( StdType tp,
const CorbaType cb 
)
inlinestatic
template<class Type>
static bool RTT::corba::AnyConversion< Type >::update ( const CORBA::Any &  any,
StdType  tp 
)
inlinestatic

Updates tp with the contents of any.

Parameters
anyContains possibly data of a type convertible to tp
tpA C++ or CORBA type in which the contents of the any are written.
Returns
true if the any was convertible to tp.

Definition at line 127 of file CorbaConversion.hpp.

References RTT::Logger::endl(), RTT::Logger::Error, RTT::internal::DataSourceTypeInfo< T >::getType(), and RTT::Logger::log().

Referenced by RTT::corba::AnyConversion< std::vector< T, _Alloc > >::toStdType(), RTT::corba::AnyConversion< std::pair< T1, T2 > >::toStdType(), RTT::corba::AnyConversion< std::map< T1, T2, _Compare, _Alloc > >::toStdType(), and RTT::corba::AnyConversion< RTT::TaskContext * >::updateAny().

template<class Type>
static bool RTT::corba::AnyConversion< Type >::updateAny ( StdType  tp,
CORBA::Any &  any 
)
inlinestatic

Updates an CORBA::Any object from of a C++/IDL type.

Parameters
tpThe value to convert to the Any.
AnAny object which will contain tp or an empty Any object if the conversion was not possible.
Returns
false if no conversion could be made

Definition at line 150 of file CorbaConversion.hpp.

References RTT::Logger::endl(), RTT::Logger::Error, RTT::internal::DataSourceTypeInfo< T >::getType(), and RTT::Logger::log().

Referenced by RTT::corba::AnyConversion< std::vector< T, _Alloc > >::toCorbaType(), RTT::corba::AnyConversion< std::pair< T1, T2 > >::toCorbaType(), RTT::corba::AnyConversion< std::map< T1, T2, _Compare, _Alloc > >::toCorbaType(), RTT::corba::CorbaTemplateProtocol< T >::updateAny(), and RTT::corba::AnyConversion< RTT::TaskContext * >::updateAny().


The documentation for this struct was generated from the following file: