IT_Bus::Any Class Reference

#include <it_bus/any.h>

Inheritance diagram for IT_Bus::Any:

IT_Bus::AnyType IT_Bus::ImplementationDetails List of all members.

Detailed Description

Class representing xsd:Any implementation for the Bus.

The xsd:any is a wildcard element that matches any element (or multiple elements, if occurrence constraints are set), subject to certain constraints.

This class is not required to be thread-safe, if thread safety is required the caller should use synchronization primitives (like Mutex) to access this class.

Definition at line 38 of file any.h.

Public Types

typedef IT_Reflect::ComplexValueRef<
Any
IT_ReflectionType

Public Member Functions

 Any ()
 Default constructor.
 Any (const char *process_contents, const NamespaceConstraints &namespace_constraints, const char *any_namespace)
 Any constructor.
virtual ~Any ()
 Destructor.
 Any (const Any &rhs)
 Copy constructor.
Anyoperator= (const Any &other)
 Assignment operator.
AnyTypecopy (const AnyType &other)
 Any now holds a copy of the contents from other, and returns a reference to self.
const QNameget_type () const
 Returns the type of the element that this Any holds.
Kind get_kind () const
 Returns the IT_Bus::AnyType::Kind for the Any class (if not overridden).
void read (const QName &name, ComplexTypeReader &reader) IT_THROW_DECL((DeserializationException))
 Read the element from the stream using the Reader.
void write (const QName &name, ComplexTypeWriter &writer) const IT_THROW_DECL((SerializationException))
 Write the element into the stream using the Writer.
void set_process_contents (const String &pc)
 Set the process contents constraint for this Any.
void set_namespace_constraints (const NamespaceConstraints &ns)
 Set the namespace constraint for this Any.
void set_any_namespace (const String &ns)
 Set the target namespace for this Any.
void set_string_data (const String &value, const QName &element_name=QName::EMPTY_QNAME)
 Set the data into any as XML.
void set_boolean (const Boolean &value, const QName &element_name)
 Set an element of type boolean into the Any.
void set_byte (const Byte &value, const QName &element_name)
 Set an element of type byte into the Any.
void set_short (const Short &value, const QName &element_name)
 Set an element of type Short into the Any.
void set_int (const Int &value, const QName &element_name)
 Set an element of type Int into the Any.
void set_long (const Long &value, const QName &element_name)
 Set an element of type Long into the Any.
void set_string (const String &value, const QName &element_name)
 Set an element of type String into the Any.
void set_QName (const QName &value, const QName &element_name)
 Set an element of type QName into the Any.
void set_float (const Float &value, const QName &element_name)
 Set an element of type Float into the Any.
void set_double (const Double &value, const QName &element_name)
 Set an element of type Double into the Any.
void set_ubyte (const UByte &value, const QName &element_name)
 Set an element of type UByte into the Any.
void set_ushort (const UShort &value, const QName &element_name)
 Set an element of type UShort into the Any.
void set_uint (const UInt &value, const QName &element_name)
 Set an element of type UInt into the Any.
void set_ulong (const ULong &value, const QName &element_name)
 Set an element of type ULong into the Any.
void set_decimal (const Decimal &value, const QName &element_name)
 Set an element of type Decimal into the Any.
void set_any_type (const AnyType &value, const QName &element_name)
 Set an element of type AnyType (or its derived type) into the Any.
QName get_element_name () const
 Get the name of the element within the Any.
String get_process_contents () const
 Get the process contents constraint for this Any.
const NamespaceConstraintsget_namespace_constraints () const
 Get the namespace constraints for this Any.
String get_any_namespace () const
 Get the target namespace for this Any.
String get_string_data () const
 Get the element in Any as a well formed XML string.
const AnyTypeget_any_type () const
 Get the element in Any as an AnyType.
Boolean get_boolean () const
 Get the value in the Any as boolean.
Byte get_byte () const
 Get the value in the Any as Byte.
Short get_short () const
 Get the value in the Any as Short.
Int get_int () const
 Get the value in the Any as Int.
Long get_long () const
 Get the value in the Any as Long.
String get_string () const
 Get the value in the Any as String.
QName get_QName () const
 Get the value in the Any as QName.
Float get_float () const
 Get the value in the Any as Float.
Double get_double () const
 Get the value in the Any as Double.
UByte get_ubyte () const
 Get the value in the Any as UByte.
UShort get_ushort () const
 Get the value in the Any as UShort.
UInt get_uint () const
 Get the value in the Any as UInt.
ULong get_ulong () const
 Get the value in the Any as ULong.
Decimal get_decimal () const
 Get the value in the Any as Decimal.
virtual bool validate_contents () const
 Validate the Any's contents for process contents and namespace validation constraints.
virtual bool validate_namespace () const
 Validate the Any's contents for namespace validation constraints only.

Public Attributes

virtual IT_Reflect::Reflection
*virtual get_reflection()
IT_THROW_DECL((IT_Reflect
const IT_Reflect::Reflection
*friend class() const IT_THROW_DECL((IT_Reflect 
AnyStreamable
 Return an instance of the IT_Reflect::Reflection type that encapsulates this instance.

Private Attributes

String m_process_contents
NamespaceConstraints m_namespace_constraints
String m_any_namespace
String m_string_data
QName m_element_name
AnyTypem_any_data


Constructor & Destructor Documentation

IT_Bus::Any::Any ( const char *  process_contents,
const NamespaceConstraints namespace_constraints,
const char *  any_namespace 
)

Any constructor.

Parameters:
const char*
Acceptable values: skip, lax or strict.
Parameters:
const NamespaceConstraints&
Acceptable values: any; a pair of not and a namespace name or absent; or a set whose members are either namespace names or absent.
Parameters:
const char* Target namespace of xsd:Any in schema


Member Function Documentation

AnyType& IT_Bus::Any::copy ( const AnyType other  ) 

Any now holds a copy of the contents from other, and returns a reference to self.

Parameters:
A reference to an AnyType instance.
Returns:
A reference to this instance.

String IT_Bus::Any::get_any_namespace (  )  const

Get the target namespace for this Any.

Returns:
String containing target namespace of this Any.

const AnyType* IT_Bus::Any::get_any_type (  )  const

Get the element in Any as an AnyType.

Primitive (builtin-types will be returned as Holder objects)

Returns:
const AnyType* AnyType object containing the element

Boolean IT_Bus::Any::get_boolean (  )  const

Get the value in the Any as boolean.

Returns:
Boolean boolean data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

Byte IT_Bus::Any::get_byte (  )  const

Get the value in the Any as Byte.

Returns:
Byte data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

Decimal IT_Bus::Any::get_decimal (  )  const

Get the value in the Any as Decimal.

Returns:
Decimal data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

Double IT_Bus::Any::get_double (  )  const

Get the value in the Any as Double.

Returns:
Double data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

QName IT_Bus::Any::get_element_name (  )  const

Get the name of the element within the Any.

Returns:
QName element name

Float IT_Bus::Any::get_float (  )  const

Get the value in the Any as Float.

Returns:
Float data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

Int IT_Bus::Any::get_int (  )  const

Get the value in the Any as Int.

Returns:
Int data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

Kind IT_Bus::Any::get_kind (  )  const [virtual]

Returns the IT_Bus::AnyType::Kind for the Any class (if not overridden).

Returns:
AnyType::Kind Note: This method currently returns AnyType::ANY regardless of the Kind of the element it is currently holding.

Reimplemented from IT_Bus::AnyType.

Long IT_Bus::Any::get_long (  )  const

Get the value in the Any as Long.

Returns:
Long data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

const NamespaceConstraints& IT_Bus::Any::get_namespace_constraints (  )  const

Get the namespace constraints for this Any.

Returns:
Array of string(s) as defined in schema

String IT_Bus::Any::get_process_contents (  )  const

Get the process contents constraint for this Any.

Returns:
String
Possible values are "lax" / "strict" / "skip"

QName IT_Bus::Any::get_QName (  )  const

Get the value in the Any as QName.

Returns:
QName data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

Short IT_Bus::Any::get_short (  )  const

Get the value in the Any as Short.

Returns:
Short data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

String IT_Bus::Any::get_string (  )  const

Get the value in the Any as String.

Returns:
String data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

String IT_Bus::Any::get_string_data (  )  const

Get the element in Any as a well formed XML string.

Returns:
String containing a well formed XML element

const QName& IT_Bus::Any::get_type (  )  const [virtual]

Returns the type of the element that this Any holds.

Returns:
QName type_name of the current element in Any (QName::EMPTY_QNAME if empty)

Implements IT_Bus::AnyType.

UByte IT_Bus::Any::get_ubyte (  )  const

Get the value in the Any as UByte.

Returns:
UByte data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

UInt IT_Bus::Any::get_uint (  )  const

Get the value in the Any as UInt.

Returns:
UInt data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

ULong IT_Bus::Any::get_ulong (  )  const

Get the value in the Any as ULong.

Returns:
ULong data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

UShort IT_Bus::Any::get_ushort (  )  const

Get the value in the Any as UShort.

Returns:
UShort data
Exceptions:
IT_bad_cast exception thrown if the element is not of this type

void IT_Bus::Any::read ( const QName name,
ComplexTypeReader reader 
)

Read the element from the stream using the Reader.

Parameters:
const QName& Name of the element
ComplexTypeReader& The reader to be used for reading
Exceptions:
DeserializationException 

void IT_Bus::Any::set_any_namespace ( const String ns  ) 

Set the target namespace for this Any.

Parameters:
const String& Target namespace of this Any.

void IT_Bus::Any::set_any_type ( const AnyType value,
const QName element_name 
)

Set an element of type AnyType (or its derived type) into the Any.

Parameters:
const AnyType& AnyType value
const QName& name of the element

void IT_Bus::Any::set_boolean ( const Boolean value,
const QName element_name 
)

Set an element of type boolean into the Any.

Parameters:
const Boolean& boolean value
const QName& name of the element

void IT_Bus::Any::set_byte ( const Byte value,
const QName element_name 
)

Set an element of type byte into the Any.

Parameters:
const Byte& byte value
const QName& name of the element

void IT_Bus::Any::set_decimal ( const Decimal value,
const QName element_name 
)

Set an element of type Decimal into the Any.

Parameters:
const Decimal& Decimal value
const QName& name of the element

void IT_Bus::Any::set_double ( const Double value,
const QName element_name 
)

Set an element of type Double into the Any.

Parameters:
const Double& Double value
const QName& name of the element

void IT_Bus::Any::set_float ( const Float value,
const QName element_name 
)

Set an element of type Float into the Any.

Parameters:
const Float& Float value
const QName& name of the element

void IT_Bus::Any::set_int ( const Int value,
const QName element_name 
)

Set an element of type Int into the Any.

Parameters:
const Int& Int value
const QName& name of the element

void IT_Bus::Any::set_long ( const Long value,
const QName element_name 
)

Set an element of type Long into the Any.

Parameters:
const Long& Long value
const QName& name of the element

void IT_Bus::Any::set_namespace_constraints ( const NamespaceConstraints ns  ) 

Set the namespace constraint for this Any.

Parameters:
const NamespaceConstraints& Array of string(s) as defined in schema

void IT_Bus::Any::set_process_contents ( const String pc  ) 

Set the process contents constraint for this Any.

Parameters:
const String& possible values are "lax" / "strict" / "skip"

void IT_Bus::Any::set_QName ( const QName value,
const QName element_name 
)

Set an element of type QName into the Any.

Parameters:
const QName& QName value
const QName& name of the element

void IT_Bus::Any::set_short ( const Short value,
const QName element_name 
)

Set an element of type Short into the Any.

Parameters:
const Short& Short value
const QName& name of the element

void IT_Bus::Any::set_string ( const String value,
const QName element_name 
)

Set an element of type String into the Any.

Parameters:
const String& String value
const QName& name of the element

void IT_Bus::Any::set_string_data ( const String value,
const QName element_name = QName::EMPTY_QNAME 
)

Set the data into any as XML.

Parameters:
const String& contains a well formed XML element
const QName& name of the element (defaults to the element name in the XML)

void IT_Bus::Any::set_ubyte ( const UByte value,
const QName element_name 
)

Set an element of type UByte into the Any.

Parameters:
const UByte& UByte value
const QName& name of the element

void IT_Bus::Any::set_uint ( const UInt value,
const QName element_name 
)

Set an element of type UInt into the Any.

Parameters:
const UInt& UInt value
const QName& name of the element

void IT_Bus::Any::set_ulong ( const ULong value,
const QName element_name 
)

Set an element of type ULong into the Any.

Parameters:
const ULong& ULong value
const QName& name of the element

void IT_Bus::Any::set_ushort ( const UShort value,
const QName element_name 
)

Set an element of type UShort into the Any.

Parameters:
const UShort& UShort value
const QName& name of the element

virtual bool IT_Bus::Any::validate_contents (  )  const [virtual]

Validate the Any's contents for process contents and namespace validation constraints.

Returns:
bool indicating whether validation passed or failed.

virtual bool IT_Bus::Any::validate_namespace (  )  const [virtual]

Validate the Any's contents for namespace validation constraints only.

Returns:
bool indicating whether validation passed or failed.

void IT_Bus::Any::write ( const QName name,
ComplexTypeWriter writer 
) const

Write the element into the stream using the Writer.

Parameters:
const QName& Name of the element
ComplexTypeReader& The reader to be used for reading
Exceptions:
DeserializationException 


Member Data Documentation

virtual IT_Reflect::Reflection* virtual get_reflection () IT_THROW_DECL((IT_Reflect const IT_Reflect::Reflection* friend class () const IT_THROW_DECL((IT_Reflect IT_Bus::Any::AnyStreamable

Return an instance of the IT_Reflect::Reflection type that encapsulates this instance.

Returns:
IT_Reflect::Reflection
Exceptions:
IT_Reflect::ReflectException 

Definition at line 590 of file any.h.


Generated on Thu Sep 7 11:39:46 2006 for Artix by  doxygen 1.4.7