IT_Bus::Integer Class Reference

#include <it_bus/integer.h>

Inheritance diagram for IT_Bus::Integer:

IT_Bus::AnySimpleType IT_Bus::AnyType IT_Bus::ImplementationDetails IT_Bus::NonNegativeInteger IT_Bus::NonPositiveInteger IT_Bus::PositiveInteger IT_Bus::NegativeInteger List of all members.

Detailed Description

Class encapsulated within generated classes derived from xsd:integer type definitions in a WSDL or XSD file.

This class stores the value as a Decimal value.

Definition at line 30 of file integer.h.

Public Types

typedef IT_Reflect::ValueRef<
IT_Bus::Integer
IT_ReflectionType

Public Member Functions

 Integer () throw (())
 No argument constructor.
 Integer (short value) throw (())
 Constructor.
 Integer (unsigned short value) throw (())
 Constructor.
 Integer (int value) throw (())
 Constructor.
 Integer (unsigned int value) throw (())
 Constructor.
 Integer (long value) throw (())
 Constructor.
 Integer (unsigned long value) throw (())
 Constructor.
 Integer (IT_LongLong value) throw (())
 Constructor.
 Integer (IT_ULongLong value) throw (())
 Constructor.
 Integer (const char *value, bool truncate=false) throw ((IT_Bus::Exception))
 Constructor.
 Integer (const String &value, bool truncate=false) throw ((IT_Bus::Exception))
 Constructor.
 Integer (const Decimal &value, bool truncate=false) throw ((IT_Bus::Exception))
 Constructor.
 Integer (const Integer &copy) throw (())
 Copy constructor.
Integeroperator= (const Integer &rhs) throw (())
 Assignment operator.
Integeroperator+= (const Integer &rhs) throw ((IT_Bus::Exception))
 Addition with a sign operator.
Integeroperator-= (const Integer &rhs) throw ((IT_Bus::Exception))
 Subtraction with a sign operator.
Integeroperator *= (const Integer &rhs) throw ((IT_Bus::Exception))
 Multiplication with a sign operator.
Integeroperator/= (const Integer &rhs) throw ((IT_Bus::Exception))
 Division with a sign operator.
Integeroperator%= (const Integer &rhs) throw ((IT_Bus::Exception))
 Modulo with a sign operator.
Integeroperator++ () throw ((IT_Bus::Exception))
 Incrementing operator.
const Integer operator++ (int) throw ((IT_Bus::Exception))
 Incrementing operator.
Integeroperator-- () throw ((IT_Bus::Exception))
 Decrementing operator.
const Integer operator-- (int) throw ((IT_Bus::Exception))
 Decrementing operator.
bool is_negative () const throw (())
 Determine whether instance value is < 0.
bool is_positive () const throw (())
 Determine whether instance value is > 0.
bool is_non_negative () const throw (())
 Determine whether instance value is >= to 0.
bool is_non_positive () const throw (())
 Determine whether instance value is <= to 0.
int compare (const Integer &other) const throw (())
 Compares the value of this instance to the value of the parameter.
const Decimalget_value () const throw (())
 Return the value of this instance as a Decimal.
void set_value (const Decimal &value, bool truncate=false) throw ((IT_Bus::Exception))
 Set the value of this instance from a Decimal.
String to_string () const throw (())
 Returns a String representation of the value of this instance.
virtual AnyTypecopy (const AnyType &copy)
 Returns a reference to an AnyType that is a copy of the AnyType parameter.
virtual AnyType::Kind get_kind () const
 Returns the IT_Bus::AnyType::Kind for the type.
virtual const QNameget_type () const
 Returns the IT_Bus::QName for the type.
virtual IT_Reflect::Reflectionget_reflection () throw ((IT_Reflect::ReflectException))
 Return an instance of the IT_Reflect::Reflection type that encapsulates this instance.
virtual const IT_Reflect::Reflectionget_reflection () const throw ((IT_Reflect::ReflectException))
 Return an instance of the IT_Reflect::Reflection type that encapsulates this instance.
virtual void write_value (AnySimpleTypeWriter &writer) const throw ((IT_Bus::SerializationException))
 Write the instance value.
virtual void read_value (AnySimpleTypeReader &reader) throw ((IT_Bus::DeserializationException))
 Read the value into the instance.

Static Public Member Functions

static bool is_valid_integer (const Decimal &value) throw (())
 Determines whether the test value is a valid integer.

Protected Member Functions

virtual void validate (const Decimal &value) const throw ((IT_Bus::Exception))
 Checks whether the test value is a valid integer.

Static Protected Member Functions

static Decimal from_string (const char *value, bool truncate=false) throw ((IT_Bus::Exception))
 Returns a Decimal initialized with the value provided as a string.
static Decimal from_signed (IT_LongLong value) throw (())
 Returns a Decimal initialized with the value provided as a longlong.
static Decimal from_unsigned (IT_ULongLong value) throw (())
 Returns a Decimal initialized with the value provided as a longlong.
static void validate_integer (const Decimal &value) throw ((IT_Bus::Exception))
 Checks whether the test value is a valid integer.

Protected Attributes

Decimal m_value
 Instance variable that holds the value for the instance.


Constructor & Destructor Documentation

IT_Bus::Integer::Integer ( short  value  )  throw (())

Constructor.

Parameters:
short value to use in initializing instance.

IT_Bus::Integer::Integer ( unsigned short  value  )  throw (())

Constructor.

Parameters:
unsigned short value to use in initializing instance.

IT_Bus::Integer::Integer ( int  value  )  throw (())

Constructor.

Parameters:
int value to use in initializing instance.

IT_Bus::Integer::Integer ( unsigned int  value  )  throw (())

Constructor.

Parameters:
unsigned int value to use in initializing instance.

IT_Bus::Integer::Integer ( long  value  )  throw (())

Constructor.

Parameters:
long value to use in initializing instance.

IT_Bus::Integer::Integer ( unsigned long  value  )  throw (())

Constructor.

Parameters:
unsigned long value to use in initializing instance.

IT_Bus::Integer::Integer ( IT_LongLong  value  )  throw (())

Constructor.

Parameters:
longlong value to use in initializing instance.

IT_Bus::Integer::Integer ( IT_ULongLong  value  )  throw (())

Constructor.

Parameters:
unsigned longlong value to use in initializing instance.

IT_Bus::Integer::Integer ( const char *  value,
bool  truncate = false 
) throw ((IT_Bus::Exception))

Constructor.

Parameters:
Pointer to character array value to use in initializing instance.
bool indicator of whether to trucate the value at a possible decimal point

IT_Bus::Integer::Integer ( const String value,
bool  truncate = false 
) throw ((IT_Bus::Exception))

Constructor.

Parameters:
String value to use in initializing instance.
bool indicator of whether to trucate the value at a possible decimal point

IT_Bus::Integer::Integer ( const Decimal value,
bool  truncate = false 
) throw ((IT_Bus::Exception))

Constructor.

Parameters:
Decimal value to use in initializing instance.
bool indicator of whether to trucate the value at the decimal point

IT_Bus::Integer::Integer ( const Integer copy  )  throw (())

Copy constructor.

Parameters:
Integer value to use in initializing instance.


Member Function Documentation

int IT_Bus::Integer::compare ( const Integer other  )  const throw (())

Compares the value of this instance to the value of the parameter.

Parameters:
Integer instance to compare to this instance.
Returns:
-1, 0, 1
If this instance is numerically greater than the comparison value, return 1. If both values are the same, return 0. Else, return -1.

const Decimal& IT_Bus::Integer::get_value (  )  const throw (())

Return the value of this instance as a Decimal.

Returns:
Decimal value of this instance.

void IT_Bus::Integer::set_value ( const Decimal value,
bool  truncate = false 
) throw ((IT_Bus::Exception))

Set the value of this instance from a Decimal.

Parameters:
Decimal value to use
bool indicator of whether to trucate the value at the decimal point The default is to not truncate the value.

The code confirms that the the first parameter is a valid integer before setting the value of this instance.

String IT_Bus::Integer::to_string (  )  const throw (())

Returns a String representation of the value of this instance.

Returns:
String

static bool IT_Bus::Integer::is_valid_integer ( const Decimal value  )  throw (()) [static]

Determines whether the test value is a valid integer.

Parameters:
Decimal value to be tested.
Returns:
bool

virtual AnyType& IT_Bus::Integer::copy ( const AnyType copy  )  [virtual]

Returns a reference to an AnyType that is a copy of the AnyType parameter.

Derived classes override this method, providing an appropriate implementation. In this base class, this method is not supported; an exception is always thrown.

Parameters:
AnyType to be copied.
Returns:
A reference to AnyType.
Exceptions:
IT_Bus::Exception with message "Copy not supported"

Reimplemented from IT_Bus::AnyType.

Reimplemented in IT_Bus::NonPositiveInteger, IT_Bus::NegativeInteger, IT_Bus::NonNegativeInteger, and IT_Bus::PositiveInteger.

virtual AnyType::Kind IT_Bus::Integer::get_kind (  )  const [virtual]

Returns the IT_Bus::AnyType::Kind for the type.

Derived subclasses override this method and return the appropriate Kind.

Returns:
AnyType::BUILT_IN.

Reimplemented from IT_Bus::AnySimpleType.

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

Returns the IT_Bus::QName for the type.

Derived subclasses implement this method and return their QName.

Returns:
NT_SCHEMA_INTEGER.

Implements IT_Bus::AnyType.

Reimplemented in IT_Bus::NonPositiveInteger, IT_Bus::NegativeInteger, IT_Bus::NonNegativeInteger, and IT_Bus::PositiveInteger.

virtual IT_Reflect::Reflection* IT_Bus::Integer::get_reflection (  )  throw ((IT_Reflect::ReflectException)) [virtual]

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

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

Reimplemented from IT_Bus::AnyType.

Reimplemented in IT_Bus::NonPositiveInteger, IT_Bus::NegativeInteger, IT_Bus::NonNegativeInteger, and IT_Bus::PositiveInteger.

virtual const IT_Reflect::Reflection* IT_Bus::Integer::get_reflection (  )  const throw ((IT_Reflect::ReflectException)) [virtual]

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

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

Reimplemented from IT_Bus::AnyType.

Reimplemented in IT_Bus::NonPositiveInteger, IT_Bus::NegativeInteger, IT_Bus::NonNegativeInteger, and IT_Bus::PositiveInteger.

virtual void IT_Bus::Integer::write_value ( AnySimpleTypeWriter writer  )  const throw ((IT_Bus::SerializationException)) [virtual]

Write the instance value.

Derived classes implement this method.

Implements IT_Bus::AnySimpleType.

virtual void IT_Bus::Integer::read_value ( AnySimpleTypeReader reader  )  throw ((IT_Bus::DeserializationException)) [virtual]

Read the value into the instance.

Derived classes implement this method.

Implements IT_Bus::AnySimpleType.

virtual void IT_Bus::Integer::validate ( const Decimal value  )  const throw ((IT_Bus::Exception)) [protected, virtual]

Checks whether the test value is a valid integer.

This method invokes the validate_integer() method.

Exceptions:
IT_Bus::Exception 

Reimplemented in IT_Bus::NonPositiveInteger, IT_Bus::NegativeInteger, IT_Bus::NonNegativeInteger, and IT_Bus::PositiveInteger.

static Decimal IT_Bus::Integer::from_string ( const char *  value,
bool  truncate = false 
) throw ((IT_Bus::Exception)) [static, protected]

Returns a Decimal initialized with the value provided as a string.

Parameters:
Pointer to the character array to use in initializing the Decimal.
bool indicator of whether to trucate the value at the decimal point
Returns:
Decimal

static Decimal IT_Bus::Integer::from_signed ( IT_LongLong  value  )  throw (()) [static, protected]

Returns a Decimal initialized with the value provided as a longlong.

Parameters:
LongLong value to use in initializing the Decimal.
Returns:
Decimal

static Decimal IT_Bus::Integer::from_unsigned ( IT_ULongLong  value  )  throw (()) [static, protected]

Returns a Decimal initialized with the value provided as a longlong.

Parameters:
ULongLong value to use in initializing the Decimal.
Returns:
Decimal

static void IT_Bus::Integer::validate_integer ( const Decimal value  )  throw ((IT_Bus::Exception)) [static, protected]

Checks whether the test value is a valid integer.

Exceptions:
IT_Bus::Exception with the message "Non-zero fractional part"


Generated on Tue Mar 20 15:28:01 2007 for Artix by  doxygen 1.5.1-p1