MASA-Core
Public Member Functions | Private Member Functions | Private Attributes
SpecialRowRAM Class Reference

Detailed Description

Class that reads and stores an Special Row in the RAM memory.

This class is the implementation of a SpecialRow that stores the cells in RAM memory. Consider that the row stored by this class is not persistent, so it is not susceptible to chekpoint restore.

Definition at line 34 of file SpecialRowRAM.hpp.

#include <SpecialRowRAM.hpp>

Inheritance diagram for SpecialRowRAM:
SpecialRow SeekableCellsReader CellsWriter CellsReader

List of all members.

Public Member Functions

 SpecialRowRAM (int id)
 Creates a new Special Row associated to the RAM memory.
virtual ~SpecialRowRAM ()
 Dispose the RAM memory allocated to this object.
virtual void close ()
 Does nothing.
virtual void truncateRow (int size)
 Truncates the allocated memory.

Private Member Functions

virtual void initialize (bool readOnly, int length)
 Allocate the initial structure for this row.
virtual int write (const cell_t *buf, int offset, int len)
 Stores the vector in a given offset.
virtual int read (cell_t *buf, int offset, int len)
 Stores the vector in a given offset.

Private Attributes

cell_trow
 Allocated memory.
int length
 Length of the allocated memory.

Constructor & Destructor Documentation

Creates a new Special Row associated to the RAM memory.

Parameters:
idthe rowId

Definition at line 37 of file SpecialRowRAM.cpp.

Dispose the RAM memory allocated to this object.

Definition at line 47 of file SpecialRowRAM.cpp.


Member Function Documentation

void SpecialRowRAM::close ( ) [virtual]

Does nothing.

Implements SpecialRow.

Definition at line 58 of file SpecialRowRAM.cpp.

void SpecialRowRAM::initialize ( bool  readOnly,
int  length 
) [private, virtual]

Allocate the initial structure for this row.

Parameters:
readOnlytrue if it must be opened for read mode, false otherwise.
lengththe initial size of the row in memory.

Implements SpecialRow.

Definition at line 70 of file SpecialRowRAM.cpp.

int SpecialRowRAM::read ( cell_t buf,
int  offset,
int  len 
) [private, virtual]

Stores the vector in a given offset.

It is guaranteed that the offset is serially decremented. Each subclass must implement this method with specific code.

Parameters:
bufvector containing the cells to be read. The data read will be stored in the first byte of this vector.
offsetthe position that the data must be read.
lenlength of the vector.
Returns:
The number of cells read.

Implements SpecialRow.

Definition at line 107 of file SpecialRowRAM.cpp.

void SpecialRowRAM::truncateRow ( int  size) [virtual]

Truncates the allocated memory.

Parameters:
sizethe number of cells to keep in the memory.

Implements SpecialRow.

Definition at line 64 of file SpecialRowRAM.cpp.

int SpecialRowRAM::write ( const cell_t buf,
int  offset,
int  len 
) [private, virtual]

Stores the vector in a given offset.

It is guaranteed that the offset is serially incremented. Each subclass must implement this method with specific code.

Parameters:
bufvector containing the cells to be saved.
offsetthe position that the vector must be stored.
lenlength of the vector.
Returns:
The number of cells stored.

Implements SpecialRow.

Definition at line 91 of file SpecialRowRAM.cpp.


Member Data Documentation

int SpecialRowRAM::length [private]

Length of the allocated memory.

Definition at line 64 of file SpecialRowRAM.hpp.

Allocated memory.

Definition at line 61 of file SpecialRowRAM.hpp.


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