VizKit  3.3.7
Public Member Functions | Private Member Functions | Private Attributes | Friends
VizKit::VisualObjectData Class Reference

VisualObjectData allows incremental data load of visual objects. More...

#include <VisualObjectData.h>

List of all members.

Public Member Functions

 VisualObjectData ()
 The constructor.
 VisualObjectData (const VisualItemIdentifier &anIdentifier)
 Another constructor.
 ~VisualObjectData ()
 The destructor.
 VisualObjectData (const VisualObjectData &other)
 Copy constructor.
VisualObjectDataoperator= (const VisualObjectData &other)
 Assignment operator.
bool operator< (const VisualObjectData &other) const
 Less than operator.
bool operator> (const VisualObjectData &other) const
 Greater than operator.
bool operator== (const VisualObjectData &other) const
 Equality operator.
bool operator!= (const VisualObjectData &other) const
 Inequality operator.
const VisualItemIdentifier getIdentifier (void) const
 Returns the identifier of the object item.
bool addData (void *dataPtr, size_t dataSize)
 Adds data to the object.
void freeData (void)
 Deallocates the data if there has been data allocated.
size_t getDataSizeUsed (void)
 Returns the number of bytes currently used by the internal data buffer.
size_t getDataSizeDeclared (void)
 Returns the declared size in bytes of the object.
void setDataSizeDeclared (const size_t &aDataSizeDeclared)
 Sets the declared size in bytes of the object.
bool dataSizeDeclaredHasBeenSet (void)
 Returns whether the declared data size has been set yet.
void release (void)
 Decrements the refCount so that the VisualObjectData is deleted the next time the enclosing VisualObject is deleted.
size_t getRefCount (void)
 Returns the ref count of the object.
bool isDownloading (void)
 Answers the question whether VisualObjectData is currently in VisualDownloadQueue and downloading data.
void setIsDownloading (bool isDownloadingBoolean)
 Sets the boolean flag to indicate that the VisualObjectData is beginning to oder ending to download data.

Private Member Functions

void copyObject (const VisualObjectData &other)
 Copy method for assignment operator and copy constructor.

Private Attributes

char * data
 Each VisualObjectData can contain arbitrary data.
size_t dataSizeUsed
 The number of bytes used for data.
size_t dataSizeDeclared
 The number of bytes declared.
bool dataSizeDeclaredHasBeenSetBool
 Flag denotes whether the declared data size has been set yet.
VisualItemIdentifieritemIdentifier
 Each VisualObjectData contains a unique identifier.
size_t dataSizeAllocated
 The number of bytes allocated for potential data use.
size_t refCount
 The internal refCount.
bool isDownloadingBool
 True if VisualObjectData is currently in VisualDownloadQueue and downloading data.

Friends

class VisualObject

Detailed Description

VisualObjectData allows incremental data load of visual objects.


Constructor & Destructor Documentation

The constructor.

Another constructor.

Parameters:
anIdentifierIdentifier of the object.

The destructor.

Copy constructor.

Parameters:
otherReference to another VisualObjectData.

Member Function Documentation

bool VisualObjectData::addData ( void *  dataPtr,
size_t  dataSize 
)

Adds data to the object.

Parameters:
dataPtrPointer to data.
dataSizeThe number of bytes of the dataPtr.
Returns:
True on success, false on failure.
Remarks:
The data is copied.
void VisualObjectData::copyObject ( const VisualObjectData other) [private]

Copy method for assignment operator and copy constructor.

Parameters:
otherAnother VisualObjectData.

Returns whether the declared data size has been set yet.

Returns:
Boolean flag answers the question whether the declared data size has been set yet.
void VisualObjectData::freeData ( void  )

Deallocates the data if there has been data allocated.

Returns the declared size in bytes of the object.

Returns:
The declared size in bytes of the object.
Remarks:
The size can be declared by a remote header file before the actual data has been fetched.

Returns the number of bytes currently used by the internal data buffer.

Returns:
The number of bytes currently used by the internal data buffer.

Returns the identifier of the object item.

Returns:
The identifier of the object item.
Remarks:
Fully implemeted by VisualObjectData class.
size_t VisualObjectData::getRefCount ( void  )

Returns the ref count of the object.

Returns:
The ref count of the object.

Answers the question whether VisualObjectData is currently in VisualDownloadQueue and downloading data.

Returns:
True if VisualObjectData is currently in VisualDownloadQueue and downloading data.
bool VisualObjectData::operator!= ( const VisualObjectData other) const

Inequality operator.

Parameters:
otherAnother VisualObjectData.
bool VisualObjectData::operator< ( const VisualObjectData other) const

Less than operator.

Parameters:
otherAnother VisualObjectData.
Remarks:
The less than operator is used by std::map for find() and sorting (if VisualObjectData is used as key_type).
VisualObjectData & VisualObjectData::operator= ( const VisualObjectData other)

Assignment operator.

Parameters:
otherReference to another VisualObjectData.
bool VisualObjectData::operator== ( const VisualObjectData other) const

Equality operator.

Parameters:
otherAnother VisualObjectData.
bool VisualObjectData::operator> ( const VisualObjectData other) const

Greater than operator.

Parameters:
otherAnother VisualObjectData.
Remarks:
The less than operator is used by std::map for find() and sorting (if VisualObjectData is used as key_type).
void VisualObjectData::release ( void  )

Decrements the refCount so that the VisualObjectData is deleted the next time the enclosing VisualObject is deleted.

void VisualObjectData::setDataSizeDeclared ( const size_t &  aDataSizeDeclared)

Sets the declared size in bytes of the object.

Parameters:
aDataSizeDeclaredThe number of bytes declared.
Remarks:
The size can be declared by a remote header file before the actual data has been fetched.
void VisualObjectData::setIsDownloading ( bool  isDownloadingBoolean)

Sets the boolean flag to indicate that the VisualObjectData is beginning to oder ending to download data.

Parameters:
isDownloadingBooleanTrue if VisualObjectData starting with download, false if not.

Friends And Related Function Documentation

friend class VisualObject [friend]

Member Data Documentation

Each VisualObjectData can contain arbitrary data.

Remarks:
The strategic memory allocation for the data is controlled internally when receiving addData() call;

The number of bytes allocated for potential data use.

This number reflects the number of bytes allocated in advance.

The number of bytes declared.

This number answers the question how many bytes are expected to be used by this object according to a declaration, found e.g. in a remote header file.

Flag denotes whether the declared data size has been set yet.

The number of bytes used for data.

This number reflects the number of valid bytes copied.

True if VisualObjectData is currently in VisualDownloadQueue and downloading data.

Returns:
True if VisualObjectData is currently in VisualDownloadQueue and downloading data.

Each VisualObjectData contains a unique identifier.

The internal refCount.

Pointers to VisualObjectData might be shared, in concurrent use at different places, so that the final destruction and memory ownership is not determined. Deleting a VisualObject therefore decrements the refCount of VisualObjectData.


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

Generated on Sun May 3 2015 20:26:32 for VizKit by doxygen 1.8.0