|
MASA-Core
|
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>
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_t * | row |
| Allocated memory. | |
| int | length |
| Length of the allocated memory. | |
| SpecialRowRAM::SpecialRowRAM | ( | int | id | ) |
Creates a new Special Row associated to the RAM memory.
| id | the rowId |
Definition at line 37 of file SpecialRowRAM.cpp.
| SpecialRowRAM::~SpecialRowRAM | ( | ) | [virtual] |
Dispose the RAM memory allocated to this object.
Definition at line 47 of file SpecialRowRAM.cpp.
| void SpecialRowRAM::close | ( | ) | [virtual] |
| void SpecialRowRAM::initialize | ( | bool | readOnly, |
| int | length | ||
| ) | [private, virtual] |
Allocate the initial structure for this row.
| readOnly | true if it must be opened for read mode, false otherwise. |
| length | the 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.
| buf | vector containing the cells to be read. The data read will be stored in the first byte of this vector. |
| offset | the position that the data must be read. |
| len | length of the vector. |
Implements SpecialRow.
Definition at line 107 of file SpecialRowRAM.cpp.
| void SpecialRowRAM::truncateRow | ( | int | size | ) | [virtual] |
Truncates the allocated memory.
| size | the 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.
| buf | vector containing the cells to be saved. |
| offset | the position that the vector must be stored. |
| len | length of the vector. |
Implements SpecialRow.
Definition at line 91 of file SpecialRowRAM.cpp.
int SpecialRowRAM::length [private] |
Length of the allocated memory.
Definition at line 64 of file SpecialRowRAM.hpp.
cell_t* SpecialRowRAM::row [private] |
Allocated memory.
Definition at line 61 of file SpecialRowRAM.hpp.
1.7.6.1