#include <acsutilAnyAide.h>
List of all members.
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
static 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. |
static std::string AnyAide::enumToString |
( |
const CORBA::Any & |
|
) |
[static, private] |
Converts the (enum) any's value to a string.
- Exceptions:
-
- Returns:
- the any param converted to a string
static 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:
-
this method thro.
Referenced by getValue().
static 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 >
static 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); } |
References AnyAide::WrongTemplateParameter::correctParameter, and getId().
static bool AnyAide::isDouble |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a double value.
static bool AnyAide::isDoubleSeq |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a doubleSeq value.
static bool AnyAide::isEnum |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains an enum value.
static bool AnyAide::isFloat |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a float value.
static bool AnyAide::isFloatSeq |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a floatSeq value.
static bool AnyAide::isLong |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a long value.
static bool AnyAide::isLongLong |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a long long value.
static bool AnyAide::isLongSeq |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a longSeq value.
static bool AnyAide::isNull |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a null value.
static bool AnyAide::isPattern |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a pattern value.
static bool AnyAide::isString |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a string value.
static bool AnyAide::isStringSeq |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a stringSeq value.
static bool AnyAide::isStruct |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a struct value.
static bool AnyAide::isULong |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a pattern value.
static bool AnyAide::isULongLong |
( |
const CORBA::Any & |
|
) |
[static] |
Returns true if the any contains a unsigned long long value.
template<class T >
static 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
ACS(CORBA) doubleSeq IFR ID
ACS(CORBA) floatSeq IFR ID
ACS(CORBA) longlong IFR ID
ACS(CORBA) longSeq IFR ID
ACS(CORBA) ACS::Pattern (aka unsigned long long) IFR ID
ACS(CORBA) stringSeq IFR ID
ACS(CORBA) ulonglong IFR ID
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: