Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

DCAtomicField Class Reference

A single atomic field of a Distributed Class, as read from a .dc file. More...

#include <dcAtomicField.h>

Inheritance diagram for DCAtomicField:

DCField List of all members.

Public Types

typedef pvector< ElementTypeElements
enum  Flags {
  F_required = 0x0001, F_broadcast = 0x0002, F_p2p = 0x0004, F_ram = 0x0008,
  F_db = 0x0010, F_clsend = 0x0020, F_clrecv = 0x0040, F_ownsend = 0x0080
}

Public Member Functions

virtual DCAtomicField * as_atomic_field ()
 Returns the same field pointer converted to an atomic field pointer, if this is in fact an atomic field; otherwise, returns NULL.

int get_num_elements () const
 Returns the number of elements of the atomic field.

DCSubatomicType get_element_type (int n) const
 Returns the numeric type of the nth element of the field.

string get_element_name (int n) const
 Returns the name of the nth element of the field.

int get_element_divisor (int n) const
 Returns the divisor associated with the nth element of the field.

string get_element_default (int n) const
 Returns the pre-formatted default value associated with the nth element of the field.

bool has_element_default (int n) const
 Returns true if the nth element of the field has a default value specified, false otherwise.

bool is_required () const
 Returns true if the "required" flag is set for this field, false otherwise.

bool is_broadcast () const
 Returns true if the "broadcast" flag is set for this field, false otherwise.

bool is_p2p () const
 Returns true if the "p2p" flag is set for this field, false otherwise.

bool is_ram () const
 Returns true if the "ram" flag is set for this field, false otherwise.

bool is_db () const
 Returns true if the "db" flag is set for this field, false otherwise.

bool is_clsend () const
 Returns true if the "clsend" flag is set for this field, false otherwise.

bool is_clrecv () const
 Returns true if the "clrecv" flag is set for this field, false otherwise.

bool is_ownsend () const
 Returns true if the "ownsend" flag is set for this field, false otherwise.

 DCAtomicField ()
virtual void write (ostream &out, int indent_level=0) const
 Generates a parseable description of the object to the indicated output stream.

virtual void generate_hash (HashGenerator &hash) const
 Accumulates the properties of this field into the hash.

int get_number () const
 Returns a unique index number associated with this field.

const string & get_name () const
 Returns the name of this field.

virtual DCMolecularFieldas_molecular_field ()
 Returns the same field pointer converted to a molecular field pointer, if this is in fact a molecular field; otherwise, returns NULL.


Public Attributes

Elements _elements
int _flags
int _number
string _name

Detailed Description

A single atomic field of a Distributed Class, as read from a .dc file.

This defines an interface to the Distributed Class, and is always implemented as a remote procedure method.

Definition at line 43 of file dcAtomicField.h.


Member Typedef Documentation

typedef pvector<ElementType> DCAtomicField::Elements
 

Definition at line 94 of file dcAtomicField.h.


Member Enumeration Documentation

enum DCAtomicField::Flags
 

Enumeration values:
F_required 
F_broadcast 
F_p2p 
F_ram 
F_db 
F_clsend 
F_clrecv 
F_ownsend 

Definition at line 97 of file dcAtomicField.h.


Constructor & Destructor Documentation

DCAtomicField::DCAtomicField  ) 
 

Definition at line 708 of file dcAtomicField.cxx.


Member Function Documentation

DCAtomicField * DCAtomicField::as_atomic_field  )  [virtual]
 

Returns the same field pointer converted to an atomic field pointer, if this is in fact an atomic field; otherwise, returns NULL.

Reimplemented from DCField.

Definition at line 431 of file dcAtomicField.cxx.

References _elements, has_element_default(), nassertr, ST_int16array, ST_int32array, and ST_int8array.

DCMolecularField * DCField::as_molecular_field  )  [virtual, inherited]
 

Returns the same field pointer converted to a molecular field pointer, if this is in fact a molecular field; otherwise, returns NULL.

Reimplemented in DCMolecularField.

Definition at line 85 of file dcField.cxx.

void DCAtomicField::generate_hash HashGenerator hash  )  const [virtual]
 

Accumulates the properties of this field into the hash.

Reimplemented from DCField.

Definition at line 778 of file dcAtomicField.cxx.

string DCAtomicField::get_element_default int  n  )  const
 

Returns the pre-formatted default value associated with the nth element of the field.

This is only valid if has_element_default() returns true, in which case this string represents the bytes that should be assigned to the field as a default value.

If the element is an array-type element, the returned value will include the two-byte length preceding the array data.

Definition at line 531 of file dcAtomicField.cxx.

References _flags, and F_db.

int DCAtomicField::get_element_divisor int  n  )  const
 

Returns the divisor associated with the nth element of the field.

This implements an implicit fixed-point system; floating-point values are to be multiplied by this value before encoding into a packet, and divided by this number after decoding.

Definition at line 501 of file dcAtomicField.cxx.

References _flags, and F_p2p.

string DCAtomicField::get_element_name int  n  )  const
 

Returns the name of the nth element of the field.

This name is strictly for documentary purposes; it does not generally affect operation. If a name is not specified, this will be the empty string.

Definition at line 479 of file dcAtomicField.cxx.

References _flags, and F_required.

DCSubatomicType DCAtomicField::get_element_type int  n  )  const
 

Returns the numeric type of the nth element of the field.

Definition at line 459 of file dcAtomicField.cxx.

const string & DCField::get_name  )  const [inherited]
 

Returns the name of this field.

Definition at line 51 of file dcField.cxx.

References NULL.

int DCAtomicField::get_num_elements  )  const
 

Returns the number of elements of the atomic field.

Definition at line 444 of file dcAtomicField.cxx.

References length, ST_blob, ST_string, ST_uint16array, ST_uint32array, ST_uint32uint8array, and ST_uint8array.

int DCField::get_number  )  const [inherited]
 

Returns a unique index number associated with this field.

This is defined implicitly when the .dc file(s) are read.

Definition at line 38 of file dcField.cxx.

References DCField::_name.

bool DCAtomicField::has_element_default int  n  )  const
 

Returns true if the nth element of the field has a default value specified, false otherwise.

Definition at line 575 of file dcAtomicField.cxx.

References _flags.

Referenced by as_atomic_field().

bool DCAtomicField::is_broadcast  )  const
 

Returns true if the "broadcast" flag is set for this field, false otherwise.

Definition at line 606 of file dcAtomicField.cxx.

References _flags, and F_p2p.

bool DCAtomicField::is_clrecv  )  const
 

Returns true if the "clrecv" flag is set for this field, false otherwise.

Definition at line 681 of file dcAtomicField.cxx.

bool DCAtomicField::is_clsend  )  const
 

Returns true if the "clsend" flag is set for this field, false otherwise.

Definition at line 666 of file dcAtomicField.cxx.

bool DCAtomicField::is_db  )  const
 

Returns true if the "db" flag is set for this field, false otherwise.

Definition at line 651 of file dcAtomicField.cxx.

bool DCAtomicField::is_ownsend  )  const
 

Returns true if the "ownsend" flag is set for this field, false otherwise.

Definition at line 696 of file dcAtomicField.cxx.

bool DCAtomicField::is_p2p  )  const
 

Returns true if the "p2p" flag is set for this field, false otherwise.

Definition at line 621 of file dcAtomicField.cxx.

References _flags, and F_ownsend.

bool DCAtomicField::is_ram  )  const
 

Returns true if the "ram" flag is set for this field, false otherwise.

Definition at line 636 of file dcAtomicField.cxx.

References _elements.

bool DCAtomicField::is_required  )  const
 

Returns true if the "required" flag is set for this field, false otherwise.

Definition at line 591 of file dcAtomicField.cxx.

References _elements.

void DCAtomicField::write ostream &  out,
int  indent_level = 0
const [virtual]
 

Generates a parseable description of the object to the indicated output stream.

Implements DCField.

Definition at line 724 of file dcAtomicField.cxx.


Member Data Documentation

Elements DCAtomicField::_elements
 

Definition at line 95 of file dcAtomicField.h.

Referenced by as_atomic_field(), is_ram(), and is_required().

int DCAtomicField::_flags
 

Definition at line 108 of file dcAtomicField.h.

Referenced by get_element_default(), get_element_divisor(), get_element_name(), has_element_default(), is_broadcast(), and is_p2p().

string DCField::_name [inherited]
 

Definition at line 55 of file dcField.h.

Referenced by DCMolecularField::get_atomic(), and DCField::get_number().

int DCField::_number [inherited]
 

Definition at line 54 of file dcField.h.


The documentation for this class was generated from the following files:
Generated on Fri May 2 01:40:59 2003 for Direct by doxygen1.3