Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

AnyAide Class Reference

#include <acsutilAnyAide.h>

List of all members.

Static Public Member Functions

CORBA::TCKind getRealType (const CORBA::Any &)
std::string getId (const CORBA::Any &)
std::string anyToString (const CORBA::Any &, unsigned short precision=0)
template<class T> T getValue (const CORBA::Any &any)
template<class T> void setValue (CORBA::Any &any, const T &value)
bool isNull (const CORBA::Any &)
bool isString (const CORBA::Any &)
bool isDouble (const CORBA::Any &)
bool isFloat (const CORBA::Any &)
bool isLong (const CORBA::Any &)
bool isLongLong (const CORBA::Any &)
bool isULongLong (const CORBA::Any &)
bool isULong (const CORBA::Any &)
bool isPattern (const CORBA::Any &)
bool isDoubleSeq (const CORBA::Any &)
bool isLongSeq (const CORBA::Any &)
bool isStringSeq (const CORBA::Any &)
bool isFloatSeq (const CORBA::Any &)
bool isEnum (const CORBA::Any &)
bool isStruct (const CORBA::Any &)

Static Public Attributes

const std::string nullType_m
const std::string stringType_m
const std::string doubleType_m
const std::string floatType_m
const std::string longType_m
const std::string longLongType_m
const std::string uLongLongType_m
const std::string uLongType_m
const std::string patternType_m
const std::string doubleSeqType_m
const std::string longSeqType_m
const std::string stringSeqType_m
const std::string floatSeqType_m
const std::string unknownType_m

Static Private Member Functions

std::string enumToString (const CORBA::Any &)


Detailed Description

AnyAide is a class whose sole purpose is to assist ALMA developers with using CORBA anys. It just provides a bunch of static methods at the moment and has not been tested yet.


Member Function Documentation

std::string AnyAide::anyToString const CORBA::Any &  ,
unsigned short  precision = 0
[static]
 

Converts the any's value to a string. Only works for native CORBA types such as longs, doubles, strings, etc at the moment and sequence typdefs defined within acscommon.idl. Support for enumerations is given however.

Parameters:
a CORBA any with a supported BACI type embedded within it
An optional parameter which sets the the precision of the return value. Only used when non-zero (zero is the default value).
Returns:
the any param converted to a string
Exceptions:
UnsupportedType exception if the implementation does not know about the CORBA type embedded within the any parameter.

std::string AnyAide::enumToString const CORBA::Any &   )  [static, private]
 

Converts the (enum) any's value to a string.

Exceptions:
UnsupportedType 
Returns:
the any param converted to a string

std::string AnyAide::getId const CORBA::Any &   )  [static]
 

Returns the IFR ID of the any (i.e., "IDL:alma/someModule/someEnum:1.0"). This method can only be used on any's with the following TCKind:

  • tk_objref
  • tk_struct
  • tk_union
  • tk_enum
  • tk_alias
  • tk_except
  • simple CORBA types supported by BACI (i.e., tk_float, tk_ulonglong, etc)

Exceptions:
an UnsupportedType exception if we cannot determine the any's IFR ID.
this method thro.

CORBA::TCKind AnyAide::getRealType const CORBA::Any &   )  [static]
 

Returns the CORBA::TCKind of the any's underlying type. TCKind is an enum created by OMG/CORBA (see page 693 of Advanced CORBA Programming with C++) which defines enumerations like tk_null, tk_ulong, tk_enum, tk_struct, etc.

template<class T>
T AnyAide::getValue const CORBA::Any &  any  )  [inline, static]
 

Converts a CORBA any to its real value and returns that. In the event that the template parameter T is not compatible with the any, an exception is thrown. Typical usage of this method will be something similar too:

Exceptions:
WrongTemplateParameter ... CORBA::any joe = ...; if (AnyAide::isPattern(joe) == true) { CORBA::Ulong myLong = getValue<CORBA::Ulong>(joe); }

bool AnyAide::isDouble const CORBA::Any &   )  [static]
 

Returns true if the any contains a double value.

bool AnyAide::isDoubleSeq const CORBA::Any &   )  [static]
 

Returns true if the any contains a doubleSeq value.

bool AnyAide::isEnum const CORBA::Any &   )  [static]
 

Returns true if the any contains an enum value.

bool AnyAide::isFloat const CORBA::Any &   )  [static]
 

Returns true if the any contains a float value.

bool AnyAide::isFloatSeq const CORBA::Any &   )  [static]
 

Returns true if the any contains a floatSeq value.

bool AnyAide::isLong const CORBA::Any &   )  [static]
 

Returns true if the any contains a long value.

bool AnyAide::isLongLong const CORBA::Any &   )  [static]
 

Returns true if the any contains a long long value.

bool AnyAide::isLongSeq const CORBA::Any &   )  [static]
 

Returns true if the any contains a longSeq value.

bool AnyAide::isNull const CORBA::Any &   )  [static]
 

Returns true if the any contains a null value.

bool AnyAide::isPattern const CORBA::Any &   )  [static]
 

Returns true if the any contains a pattern value.

bool AnyAide::isString const CORBA::Any &   )  [static]
 

Returns true if the any contains a string value.

bool AnyAide::isStringSeq const CORBA::Any &   )  [static]
 

Returns true if the any contains a stringSeq value.

bool AnyAide::isStruct const CORBA::Any &   )  [static]
 

Returns true if the any contains a struct value.

bool AnyAide::isULong const CORBA::Any &   )  [static]
 

Returns true if the any contains a pattern value.

bool AnyAide::isULongLong const CORBA::Any &   )  [static]
 

Returns true if the any contains a unsigned long long value.

template<class T>
void AnyAide::setValue CORBA::Any &  any,
const T &  value
[inline, static]
 

Sets the value of a CORBA any. This method sets the value of a CORBA any by copying the value.

Parameters:
any CORBA any the value will be embedded into
value Value to be placed in the CORBA any


Member Data Documentation

const std::string AnyAide::doubleSeqType_m [static]
 

ACS(CORBA) doubleSeq IFR ID

const std::string AnyAide::doubleType_m [static]
 

ACS(CORBA) double IFR ID

const std::string AnyAide::floatSeqType_m [static]
 

ACS(CORBA) floatSeq IFR ID

const std::string AnyAide::floatType_m [static]
 

ACS(CORBA) float IFR ID

const std::string AnyAide::longLongType_m [static]
 

ACS(CORBA) longlong IFR ID

const std::string AnyAide::longSeqType_m [static]
 

ACS(CORBA) longSeq IFR ID

const std::string AnyAide::longType_m [static]
 

ACS(CORBA) long IFR ID

const std::string AnyAide::nullType_m [static]
 

ACS(CORBA) null IFR ID

const std::string AnyAide::patternType_m [static]
 

ACS(CORBA) ACS::Pattern (aka unsigned long long) IFR ID

const std::string AnyAide::stringSeqType_m [static]
 

ACS(CORBA) stringSeq IFR ID

const std::string AnyAide::stringType_m [static]
 

ACS(CORBA) string IFR ID

const std::string AnyAide::uLongLongType_m [static]
 

ACS(CORBA) ulonglong IFR ID

const std::string AnyAide::uLongType_m [static]
 

ACS(CORBA) ulong IFR ID

const std::string AnyAide::unknownType_m [static]
 

This ID is returned by methods in the AnyAide class if the IFR ID cannot be determined for some reason or another. This is possible for certain simple CORBA types (short, char, etc) that are not supported by BACI


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:35:56 2009 for ACS C++ API by doxygen 1.3.8