iopc::ENumber< T > Class Template Reference
[iopcmeta]

Template class for all numeric enhanced datatypes. More...

#include <enhancedNumber.h>

Inheritance diagram for iopc::ENumber< T >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual const TypegetType () const
 Returns a Type Description representing the type of the current object.
virtual void * externalizeCopy (unsigned int maxlength=0)
 Creates a copy of this object's value and returns a pointer to it.
virtual void * externalizeEmptyBuffer (unsigned int length=0)
 Creates an empty buffer for obtaining the value.
virtual void updateFromExternalized ()
 Updates this object's value from the externalized buffer.
virtual unsigned int getBufferSize ()
 Returns externalized buffer size in bytes.
virtual const TypegetInnerType () const
 Returns inner type for specified enhanced type.
virtual std::string toString () const
 Returns string representation of this object.
virtual Objectclone () const
 Returns a copy of this object.
virtual int compare (const Object &o) const
 Compares two enhanced numbers.


Detailed Description

template<typename T>
class iopc::ENumber< T >

Template class for all numeric enhanced datatypes.

It provides operator overloads basic mathematical operations, assignments and casts to standard C++ numeric data types.


Member Function Documentation

template<typename T>
void * iopc::ENumber< T >::externalizeCopy ( unsigned int  maxlength = 0  )  [inline, virtual]

Creates a copy of this object's value and returns a pointer to it.

Type of the copy is the type of the wrapped value (numbers) or char/wchar_t* for EString or EWString.

Parameters:
maxlength Maximum allocated length of externalised copy. For numbers this value is ignored. For strings this value must by greater than 0.

Implements iopc::EnhancedTypeBase.

template<typename T>
void * iopc::ENumber< T >::externalizeEmptyBuffer ( unsigned int  length = 0  )  [inline, virtual]

Creates an empty buffer for obtaining the value.

Parameters:
length Allocated length of externalised copy. For numbers this value is ignored. For strings this value must by greater than 0.

Implements iopc::EnhancedTypeBase.

template<typename T>
const Type & iopc::ENumber< T >::getInnerType (  )  const [inline, virtual]

Returns inner type for specified enhanced type.

Inner type represents a type that is wrapped by the enhanced data type. It should be one of the basic C++ types or STL strings.

Implements iopc::EnhancedTypeBase.

template<typename T>
Object * iopc::ENumber< T >::clone (  )  const [inline, virtual]

Returns a copy of this object.

Object descendants may implement this method in various ways. Default implementation returns only an empty Object instance.

Reimplemented from iopc::Object.

template<typename T>
int iopc::ENumber< T >::compare ( const Object o  )  const [inline, virtual]

Compares two enhanced numbers.

Performs a standard numeric compare

Returns:
-1 If the current value is less than the value passed, 0 if both values are equal and 1 if the current value is greater.
Exceptions:
IopcIncorrectUsageException if comparing other than E(W)String types

Reimplemented from iopc::Object.


The documentation for this class was generated from the following file:

Generated on Tue Apr 14 16:46:36 2009 for IOPC 2 by  doxygen 1.5.6