AnyAide

NAME
SYNOPSIS
Detailed Description
Member Function Documentation
Member Data Documentation
Author

NAME

AnyAide −

SYNOPSIS

#include <acsutilAnyAide.h>

Classes

struct UnsupportedType

struct WrongTemplateParameter

Static Public Member Functions

static CORBA::TCKind getRealType (const CORBA::Any &)

static std::string getId (const CORBA::Any &)

static std::string anyToString (const CORBA::Any &, unsigned short precision=0)

template<class T > static T getValue (const CORBA::Any &any)

template<class T > static void setValue (CORBA::Any &any, const T &value)

static bool isNull (const CORBA::Any &)

static bool isString (const CORBA::Any &)

static bool isDouble (const CORBA::Any &)

static bool isFloat (const CORBA::Any &)

static bool isLong (const CORBA::Any &)

static bool isLongLong (const CORBA::Any &)

static bool isULongLong (const CORBA::Any &)

static bool isULong (const CORBA::Any &)

static bool isPattern (const CORBA::Any &)

static bool isDoubleSeq (const CORBA::Any &)

static bool isLongSeq (const CORBA::Any &)

static bool isStringSeq (const CORBA::Any &)

static bool isFloatSeq (const CORBA::Any &)

static bool isEnum (const CORBA::Any &)

static bool isStruct (const CORBA::Any &)

Static Public Attributes

static const std::string nullType_m

static const std::string stringType_m

static const std::string doubleType_m

static const std::string floatType_m

static const std::string longType_m

static const std::string longLongType_m

static const std::string uLongLongType_m

static const std::string uLongType_m

static const std::string patternType_m

static const std::string doubleSeqType_m

static const std::string longSeqType_m

static const std::string stringSeqType_m

static const std::string floatSeqType_m

static const std::string unknownType_m

Static Private Member Functions

static 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

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:

UnsupportedType

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:

an UnsupportedType exception if we cannot determine the any’s IFR ID.

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

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

Author

Generated automatically by Doxygen for ACS-2015.2 C++ API from the source code.