Public Member Functions | Static Public Member Functions

VDRIVE::Disk Class Reference

#include <Disk.h>

List of all members.

Public Member Functions

 Disk (xercesc::DOMElement *data)
 Disk (int64_t id, int64_t capacity, void *data)
 Disk (const Disk &orig)
virtual ~Disk ()
int64_t getId () const
void setId (int64_t id)
int64_t getCapacity () const
void setCapacity (int64_t capacity)
void * getData () const
void setData (void *data)
virtual xercesc::DOMElement * toXML (xercesc::DOMDocument *doc)

Static Public Member Functions

static std::string getXMLRootType ()
static void storeDiskList (std::list< Disk * > *disks, std::string filename)
static std::list< Disk * > * loadDiskList (std::string filename)
static void storeDiskListDBFile (std::list< Disk * > *disks, std::string filename)
static std::list< Disk * > * loadDiskListDBFile (std::string filename)

Detailed Description

This class represents a Disk for the Distributor. Each Disk consists of an unique ID (in the list of Disks used by this lib), a capacity and a reference to some data, that can be used by the person instantiating a Disk.

Author:
Sascha Effert <fermat@uni-paderborn.de>

Constructor & Destructor Documentation

Disk::Disk ( xercesc::DOMElement *  data )

Create a new instance from the data in the given XML Element.

Parameters:
dataAn XML-Element containing the description of a disk.
Disk::Disk ( int64_t  id,
int64_t  capacity,
void *  data 
)

instantiates a new Disk with the given values.

Parameters:
idID of the disk. Has to be unique all over this library.
capacityCapacity of the Disk in bytes. (This can also be in any other scale, but has to be same for ExtentSize of Distributor)
dataPointer to be used by developer instantiating this disk. May not be changed by Distributors!
Disk::Disk ( const Disk orig )

copy constructor

Parameters:
origoriginal Disk
Disk::~Disk (  ) [virtual]

Destructor


Member Function Documentation

int64_t Disk::getCapacity (  ) const

Get the Capacity of the Disk in bytes. (This can also be in any other scale, but has to be same for ExtentSize of Distributor)

Returns:
Capacity of the Disk in bytes. (This can also be in any other scale, but has to be same for ExtentSize of Distributor)
void * Disk::getData (  ) const

Get the Pointer to be used by developer instantiating this disk. May not be changed by Distributors!

Returns:
Pointer to be used by developer instantiating this disk. May not be changed by Distributors!
int64_t Disk::getId (  ) const

Get the ID of the disk. Has to be unique all over this library.

Returns:
ID of the disk. Has to be unique all over this library.
static std::string VDRIVE::Disk::getXMLRootType (  ) [inline, static]

Get the Root-Type of XML-Elements representing this class.

Returns:
the Root-Type of XML-Elements representing this class.
std::list< Disk * > * Disk::loadDiskList ( std::string  filename ) [static]

Using this method it is possible to read a list of disks out of a file.

Parameters:
filenameThe name of the file containing the disks.
Returns:
A list with the disks readen out of the file.
std::list< Disk * > * Disk::loadDiskListDBFile ( std::string  filename ) [static]

Using this method it is possible to read a list of disks out of a sqlite db file.

Parameters:
filenameThe name of the file containing the disks.
Returns:
A list with the disks readen out of the file.
void Disk::setCapacity ( int64_t  capacity )

Set the Capacity of the Disk in bytes. (This can also be in any other scale, but has to be same for ExtentSize of Distributor)

Parameters:
capacityCapacity of the Disk in bytes. (This can also be in any other scale, but has to be same for ExtentSize of Distributor)
void Disk::setData ( void *  data )

Set the Pointer to be used by developer instantiating this disk. May not be changed by Distributors!

Parameters:
dataPointer to be used by developer instantiating this disk. May not be changed by Distributors!
void Disk::setId ( int64_t  id )

Set the ID of the disk. Has to be unique all over this library.

Parameters:
idID of the disk. Has to be unique all over this library.
void Disk::storeDiskList ( std::list< Disk * > *  disks,
std::string  filename 
) [static]

Using this method it is possible to store a list of disks in a file.

Parameters:
disksThe disks to be stored
filenameThe name of the file the disks shall be stored in.
void Disk::storeDiskListDBFile ( std::list< Disk * > *  disks,
std::string  filename 
) [static]

Using this method it is possible to store a list of disks in a sqlite db file.

Parameters:
disksThe disks to be stored
filenameThe name of the file the disks shall be stored in.
xercesc::DOMElement * Disk::toXML ( xercesc::DOMDocument *  doc ) [virtual]

build an XML-Version of this object

Parameters:
docthe document needed to create new XML Elements
Returns:
a new Element containing the description of this object.

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