Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::BoxData Class Reference
[FileData]

Reads and writes a Box to and from an XML data file. More...

#include <BoxData.h>

Inheritance diagram for OSCAR::BoxData:

Inheritance graph
[legend]
List of all members.

Public Methods

 BoxData (const String &inputFileName, OSCARError &err=DUMMY_ERROR(noError), const String &rootElementName=String("Box"), const String name=String(""))
 BoxData (const char *xmlDataString, OSCARError &err=DUMMY_ERROR(noError), const String &rootElementName=String("Box"), const String name=String(""))
 BoxData (const DOMElement *coneNode, OSCARError &err=DUMMY_ERROR(noError), const String &rootElementName=String("Box"), const String name=String(""))
 BoxData (const Box &box, OSCARError &err=DUMMY_ERROR(noError), const String &rootElementName=String("Box"), const String name=String(""))
 BoxData (const BoxData &rhs)
virtual ~BoxData ()
BoxData & operator= (const BoxData &rhs)
const BoxGetParameters () const
bool SetParameters (const Box &box)
bool Output (std::ostream &out, bool nameSpaceHeader=false) const

Static Public Methods

bool Output (const Box *box, std::ostream &strm, const String &rootElementName=String("Box"), bool nameSpaceHeader=false)

Protected Methods

virtual bool parseParameters (const DOMElement *coneNode)

Protected Attributes

Boxbox

Detailed Description

Author:
Chetan Kapoor


Constructor & Destructor Documentation

OSCAR::BoxData::BoxData const String   inputFileName,
OSCARError   err = DUMMY_ERROR(noError),
const String   rootElementName = String("Box"),
const String    name = String("")
 

Constructor.

This is the constructor for an object of type BoxData. Use this to construct an BoxData object by supplying a datafile that contains the Box data specified in XML. Possible errors that may occur include a fileOpenError or xmlError. A call to LoadData() should follow a succesful constructor call.

Parameters:
inputFileName This is a file that contains the Box model specified in XML format
err A reference to an object of type OSCARError. The default OSCARError object holds values that imply a "No Error" state. This is an error code that is returned.
name An String that specifies the Name of the object being created.
Exceptions:
xmlError xmlError Call GetError() for more information
See also:
LoadData()

OSCAR::BoxData::BoxData const char *    xmlDataString,
OSCARError   err = DUMMY_ERROR(noError),
const String   rootElementName = String("Box"),
const String    name = String("")
 

Constructor.

Use this to construct an BoxData object from a char string holding the XML description of a Box. Possible errors that may occur include or xmlError. A call to LoadData() should follow a succesful constructor call.

Parameters:
xmlDataString A null terminated string of char that contains XML data. Each XML file should specify the data with the target namespace rrgOSCAR with namespace www.robotics.utexas.edu and conforming to the schemas defined for OSCAR. See www.robotics.utexas.edu for valid schemas.
err A reference to an object of type OSCARError. The default OSCARError object holds values that imply a "No Error" state. This is an error code that is returned.
name An String that specifies the Name of the object being created.
Exceptions:
xmlError xmlError Call GetError() for more information
See also:
XMLData(const String& inputFileName, OSCARError &err = DUMMY_ERROR(noError), const String name = String(" "))

LoadData()

Exceptions:
xmlError xmlError Call GetError() for more information
See also:
LoadData()

OSCAR::BoxData::BoxData const DOMElement *    coneNode,
OSCARError   err = DUMMY_ERROR(noError),
const String   rootElementName = String("Box"),
const String    name = String("")
 

Constructor that allows xml data to be loaded from pre validated DOMElement containing a Box node. A call to LoadData() should follow a succesful constructor call.

Parameters:
coneNode A DOMElement that contains the data that will be parsed. It is assumed that the the target namespace is rrgOSCAR with namespace www.robotics.utexas.edu and data conforms to the schemas defined for OSCAR. See www.robotics.utexas.edu for valid schemas.
err A reference to an object of type OSCARError. The default OSCARError object holds values that imply a "No Error" state. This is an error code that is returned.
name An String that specifies the Name of the object being created.
Exceptions:
xmlError xmlError Call GetError() for more information
See also:
BoxData(const String& inputFileName, OSCARError &err = DUMMY_ERROR(noError), const String name = String(" "))

LoadData()

OSCAR::BoxData::BoxData const Box   box,
OSCARError   err = DUMMY_ERROR(noError),
const String   rootElementName = String("Box"),
const String    name = String("")
 

Creates a BoxData object from a Box object. Use this constructor to serialize a Box object into XML A call to LoadData() is not needed after this constructor call.

Parameters:
box A valid Box object that can then be serialized into XML by calling Output method.
err A reference to an object of type OSCARError. The default OSCARError object holds values that imply a "No Error" state. This is an error code that is returned.
name An String that specifies the Name of the object being created.
See also:
Output(std::ostream& out, bool nameSpaceHeader = false) const;

OSCAR::BoxData::BoxData const BoxData &    rhs
 

Copy Constructor.

This is the Copy Constructor for an object of type BoxData. Use this to construct an BoxData object from an existing BoxData object.

Parameters:
rhs A BoxData object that will be used to initialize this new object.

virtual OSCAR::BoxData::~BoxData   [virtual]
 

Destructor.

This is the Destructor for an object of type BoxData.


Member Function Documentation

const Box* OSCAR::BoxData::GetParameters   const
 

Returns the Box that represents the Box data.

Returns:
An Box object that is serialized using this class
See also:
SetParameters(const Box& Box)

BoxData& OSCAR::BoxData::operator= const BoxData &    rhs
 

Assignment Operator.

This is the Assignment Operator for an object of type BoxData.

Parameters:
rhs A BoxData object that goes on the right hand side of the = operator
Returns:
A reference to the object on the left hand side of the = operator

bool OSCAR::BoxData::Output const Box   box,
std::ostream &    strm,
const String   rootElementName = String("Box"),
bool    nameSpaceHeader = false
[static]
 

Outputs any given Box object into XML. This does not output the internally stored object. Also, this method is declared static and as such can be called to serialize any Box object without creating a BoxData object.

Parameters:
box A Box object that needs to be serailzed to XML
out A valid outputs stream to which data is outputed
nameSpaceHeader If true, the name space is appended to the root element. Normally, this should be true if you are outputting this data as a stand alone document. If you are outputting as a subset of higher level xml data, it should be false. The root node of the overall document should however output the namespace header. Default value is false.
Returns:
A true or a false. If false, call GetError() for detailed error information
Exceptions:
 

bool OSCAR::BoxData::Output std::ostream &    out,
bool    nameSpaceHeader = false
const [virtual]
 

Outputs stored data CylisphereModel in XML format. The root element for BoxData is .

Parameters:
out A valid outputs stream to which data is outputed
nameSpaceHeader If true, the name space is appended to the root element. Normally, this should be true if you are outputting this data as a stand alone document. If you are outputting as a subset of higher level xml data, it should be false. The root node of the overall document should however output the namespace header. Default value is false.
Returns:
A true or a false. If false, call GetError() for detailed error information
Exceptions:
 

Implements OSCAR::XMLData.

virtual bool OSCAR::BoxData::parseParameters const DOMElement *    coneNode [protected, virtual]
 

Overloaded method for parsing an element of type CylisphereType.

Parameters:
coneNode A DOMElement that points to a Box node

Reimplemented from OSCAR::XMLData.

bool OSCAR::BoxData::SetParameters const Box   box
 

Set the Box that will be serialized by this object.

Returns:
true or false. If false, call GetError()
See also:
GetParameters() const


Member Data Documentation

Box* OSCAR::BoxData::box [protected]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations