Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
igtl::Unit Class Reference

#include <igtlUnit.h>

Inheritance diagram for igtl::Unit:
Inheritance graph
[legend]
Collaboration diagram for igtl::Unit:
Collaboration graph
[legend]

Public Types

enum  {
  SI_PREFIX_NONE = 0x0,
  SI_PREFIX_DEKA = 0x1,
  SI_PREFIX_HECTO = 0x2,
  SI_PREFIX_KILO = 0x3,
  SI_PREFIX_MEGA = 0x4,
  SI_PREFIX_GIGA = 0x5,
  SI_PREFIX_TERA = 0x6,
  SI_PREFIX_PETA = 0x7,
  SI_PREFIX_DECI = 0x9,
  SI_PREFIX_CENTI = 0xA,
  SI_PREFIX_MILLI = 0xB,
  SI_PREFIX_MICRO = 0xC,
  SI_PREFIX_NANO = 0xD,
  SI_PREFIX_PICO = 0xE,
  SI_PREFIX_FEMTO = 0xF
}
 
enum  {
  SI_BASE_NONE = 0x00,
  SI_BASE_METER = 0x01,
  SI_BASE_GRAM = 0x02,
  SI_BASE_SECOND = 0x03,
  SI_BASE_AMPERE = 0x04,
  SI_BASE_KELVIN = 0x05,
  SI_BASE_MOLE = 0x06,
  SI_BASE_CANDELA = 0x07,
  SI_DERIVED_RADIAN = 0x08,
  SI_DERIVED_STERADIAN = 0x09,
  SI_DERIVED_HERTZ = 0x0A,
  SI_DERIVED_NEWTON = 0x0B,
  SI_DERIVED_PASCAL = 0x0C,
  SI_DERIVED_JOULE = 0x0D,
  SI_DERIVED_WATT = 0x0E,
  SI_DERIVED_COULOMB = 0x0F,
  SI_DERIVED_VOLT = 0x10,
  SI_DERIVED_FARAD = 0x11,
  SI_DERIVED_OHM = 0x12,
  SI_DERIVED_SIEMENS = 0x13,
  SI_DERIVED_WEBER = 0x14,
  SI_DERIVED_TESLA = 0x15,
  SI_DERIVED_HENRY = 0x16,
  SI_DERIVED_LUMEN = 0x17,
  SI_DERIVED_LUX = 0x18,
  SI_DERIVED_BECQUEREL = 0x19,
  SI_DERIVED_GRAY = 0x1A,
  SI_DERIVED_SIEVERT = 0x1B,
  SI_NUM_UNIT_TYPES = 0x1C
}
 
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Unit Self
 
typedef Object Superclass
 

Public Member Functions

int Append (int unit, int exp)
 
virtual LightObject::Pointer CreateAnother () const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
virtual void Delete ()
 
bool GetDebug () const
 
virtual const char * GetNameOfClass () const
 
virtual int GetReferenceCount () const
 
 igtlNewMacro (Self)
 
 igtlTypeMacro (Object, LightObject)
 
 igtlTypeMacro (Unit, Object)
 
void Init ()
 
igtlUnit Pack ()
 
void Print (std::ostream &os) const
 
virtual void Register () const
 
void SetDebug (bool debugFlag) const
 
int SetPrefix (int prefix)
 
virtual void SetReferenceCount (int)
 
int Unpack (igtlUnit unit)
 
virtual void UnRegister () const
 

Static Public Member Functions

static void BreakOnError ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 

Protected Member Functions

virtual void PrintSelf (std::ostream &os) const
 
 Unit ()
 
virtual ~Unit ()
 
virtual void PrintHeader (std::ostream &os) const
 
virtual void PrintTrailer (std::ostream &os) const
 

Protected Attributes

volatile int m_ReferenceCount
 
SimpleFastMutexLock m_ReferenceCountLock
 

Detailed Description

The Unit class provides a general way to describe unites defined in International System of Unites (SI) in its 8-byte (or 64-bit) field. The field is designed to specifiy a unit consisting of SI-prefix (e.g. milli, micro, kilo etc...) and combination of SI-base and/or SI-derived unites. The bites in the field are assigned as follows:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... |PREFIX | UNIT0 | EXP0 | UNIT1 | EXP1 | UNIT2 | EXP2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... 0 1 2 3 4

...-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ EXP2 | UNIT3 | EXP3 | UNIT4 | EXP4 | UNIT5 | EXP5 | ...-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4 5 6 7

Definition at line 44 of file igtlUnit.h.

Member Typedef Documentation

Definition at line 110 of file igtlUnit.h.

Definition at line 109 of file igtlUnit.h.

Definition at line 107 of file igtlUnit.h.

Definition at line 108 of file igtlUnit.h.

Member Enumeration Documentation

anonymous enum

SI Prefix.

Enumerator
SI_PREFIX_NONE 
SI_PREFIX_DEKA 
SI_PREFIX_HECTO 
SI_PREFIX_KILO 
SI_PREFIX_MEGA 
SI_PREFIX_GIGA 
SI_PREFIX_TERA 
SI_PREFIX_PETA 
SI_PREFIX_DECI 
SI_PREFIX_CENTI 
SI_PREFIX_MILLI 
SI_PREFIX_MICRO 
SI_PREFIX_NANO 
SI_PREFIX_PICO 
SI_PREFIX_FEMTO 

Definition at line 49 of file igtlUnit.h.

anonymous enum

SI Units.

Enumerator
SI_BASE_NONE 
SI_BASE_METER 
SI_BASE_GRAM 
SI_BASE_SECOND 
SI_BASE_AMPERE 
SI_BASE_KELVIN 
SI_BASE_MOLE 
SI_BASE_CANDELA 
SI_DERIVED_RADIAN 
SI_DERIVED_STERADIAN 
SI_DERIVED_HERTZ 
SI_DERIVED_NEWTON 
SI_DERIVED_PASCAL 
SI_DERIVED_JOULE 
SI_DERIVED_WATT 
SI_DERIVED_COULOMB 
SI_DERIVED_VOLT 
SI_DERIVED_FARAD 
SI_DERIVED_OHM 
SI_DERIVED_SIEMENS 
SI_DERIVED_WEBER 
SI_DERIVED_TESLA 
SI_DERIVED_HENRY 
SI_DERIVED_LUMEN 
SI_DERIVED_LUX 
SI_DERIVED_BECQUEREL 
SI_DERIVED_GRAY 
SI_DERIVED_SIEVERT 
SI_NUM_UNIT_TYPES 

Definition at line 68 of file igtlUnit.h.

Constructor & Destructor Documentation

igtl::Unit::Unit ( )
protected

constructor

virtual igtl::Unit::~Unit ( )
protectedvirtual

destructor

Member Function Documentation

int igtl::Unit::Append ( int  unit,
int  exp 
)

Appends a unit with exponential.

static void igtl::LightObject::BreakOnError ( )
staticinherited

This method is called when igtlExceptionMacro executes. It allows the debugger to break on error.

virtual LightObject::Pointer igtl::Object::CreateAnother ( ) const
virtualinherited

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from igtl::LightObject.

virtual void igtl::Object::DebugOff ( ) const
virtualinherited

Turn debugging output off.

virtual void igtl::Object::DebugOn ( ) const
virtualinherited

Turn debugging output on.

virtual void igtl::LightObject::Delete ( )
virtualinherited

Delete an igtl object. This method should always be used to delete an object when the new operator was used to create it. Using the C delete method will not work with reference counting.

bool igtl::Object::GetDebug ( ) const
inherited

Get the value of the debug flag.

static bool igtl::Object::GetGlobalWarningDisplay ( )
staticinherited

This is a global flag that controls whether any debug, warning or error messages are displayed.

virtual const char* igtl::LightObject::GetNameOfClass ( ) const
inlinevirtualinherited

Return the name of this class as a string. Used by the object factory (implemented in New()) to instantiate objects of a named type. Also used for debugging and other output information.

Definition at line 84 of file igtlLightObject.h.

virtual int igtl::LightObject::GetReferenceCount ( ) const
inlinevirtualinherited

Gets the reference count on this object.

Definition at line 110 of file igtlLightObject.h.

static void igtl::Object::GlobalWarningDisplayOff ( )
inlinestaticinherited

This is a global flag that controls whether any debug, warning or error messages are displayed.

Definition at line 116 of file igtlObject.h.

References igtl::Object::SetGlobalWarningDisplay().

static void igtl::Object::GlobalWarningDisplayOn ( )
inlinestaticinherited

This is a global flag that controls whether any debug, warning or error messages are displayed.

Definition at line 114 of file igtlObject.h.

References igtl::Object::SetGlobalWarningDisplay().

igtl::Unit::igtlNewMacro ( Self  )
igtl::Object::igtlTypeMacro ( Object  ,
LightObject   
)
inherited

Standard part of all igtl objects.

igtl::Unit::igtlTypeMacro ( Unit  ,
Object   
)
void igtl::Unit::Init ( )

Initializes the class.

static Pointer igtl::Object::New ( )
staticinherited

Method for creation through the object factory.

igtlUnit igtl::Unit::Pack ( )

Packs (or serializes) the unit into a 64-bit value.

void igtl::LightObject::Print ( std::ostream &  os) const
inherited

Cause the object to print itself out.

virtual void igtl::LightObject::PrintHeader ( std::ostream &  os) const
protectedvirtualinherited

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

virtual void igtl::Object::PrintSelf ( std::ostream &  os) const
protectedvirtualinherited

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from igtl::LightObject.

Reimplemented in igtl::MultiThreader, igtl::MutexLock, igtl::ObjectFactoryBase, igtl::Socket, igtl::FastMutexLock, igtl::TimeStamp, igtl::ServerSocket, and igtl::ClientSocket.

virtual void igtl::LightObject::PrintTrailer ( std::ostream &  os) const
protectedvirtualinherited

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

virtual void igtl::Object::Register ( ) const
virtualinherited

Return this objects modified time. Update the modification time for this object. Many filters rely on the modification time to determine if they need to recompute their data. Increase the reference count (mark as used by another object).

Reimplemented from igtl::LightObject.

void igtl::Object::SetDebug ( bool  debugFlag) const
inherited

Set the value of the debug flag. A non-zero value turns debugging on.

static void igtl::Object::SetGlobalWarningDisplay ( bool  flag)
staticinherited

This is a global flag that controls whether any debug, warning or error messages are displayed.

Referenced by igtl::Object::GlobalWarningDisplayOff(), and igtl::Object::GlobalWarningDisplayOn().

int igtl::Unit::SetPrefix ( int  prefix)

Sets the SI prefix.

virtual void igtl::Object::SetReferenceCount ( int  )
virtualinherited

Sets the reference count (use with care)

Reimplemented from igtl::LightObject.

int igtl::Unit::Unpack ( igtlUnit  unit)

Unpacks the unit from a 64-bit value.

virtual void igtl::Object::UnRegister ( ) const
virtualinherited

Decrease the reference count (release by another object).

Reimplemented from igtl::LightObject.

Member Data Documentation

volatile int igtl::LightObject::m_ReferenceCount
mutableprotectedinherited

Number of uses of this object by other objects.

Definition at line 131 of file igtlLightObject.h.

SimpleFastMutexLock igtl::LightObject::m_ReferenceCountLock
mutableprotectedinherited

Mutex lock to protect modification to the reference count

Definition at line 134 of file igtlLightObject.h.


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

Generated at Wed Dec 4 2013 03:48:29 for OpenIGTLink by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2012