Scanframe Modular Application 0.1.0
|
Class for creating and referencing global created data called result data. This class allows linking of member functions of other classes to handle events generated by the data server and client. More...
#include <ResultData.h>
Public Member Functions | |
ResultData () | |
Default constructor. | |
ResultData (const ResultData &rd) | |
Copy constructor. | |
ResultData (id_type id, bool set_desired=false) | |
Constructor for creating an instance that attaches to an existing reference by id. | |
ResultData (const std::string &definition, ResultData::id_type id_ofs=0) | |
Constructor for creating a completely new reference. | |
ResultData (const Definition &definition, ResultData::id_type id_ofs=0) | |
Creates a new result using the passed definition structure. | |
~ResultData () override | |
Overridden destructor. | |
bool | setup (const std::string &definition, id_type id_ofs=0) |
Creates a new reference from a setup string for this instance. | |
bool | setup (const Definition &definition, id_type id_ofs) |
Creates a new TResultDataReference from a structure for this instance. | |
bool | setup (const ResultData &rd) |
Sets reference as the reference in the past instance. | |
bool | setup (ResultData::id_type id, bool set_did=false) |
Sets reference to other by id. | |
std::string | getSetupString () const |
Gets the setup string for this instance. | |
bool | setAccessRange (const Range &rng, bool skip_self=false) |
Sets the accessible range. | |
bool | setAccessRange (Range::size_type stop, bool skip_self=false) |
Same as setAccessRange where the start value is default 0. | |
void | setHandler (ResultDataHandler *handler) |
Sets an event handler for this instance. | |
const ResultDataHandler * | getHandler () const |
Gets the handler pointer of this instance set with setHandler(). | |
void | makeOwner () |
Make this instance owner of this result. | |
ResultData & | getOwner () |
Gets reference of the owning instance. | |
bool | isOwner () const |
Checks if this is the owner of this result. | |
void | setUserData (void *data) |
Sets the void pointer data member for general purposes to cast in a handler. | |
void * | getUserData () const |
Gets the UserData void pointer data member. | |
bool | isValid () const |
Gets the instance validity. | |
data_type | getValueOffset () const |
Returns the correction offset for each value to get the real value. | |
data_type | getValueRange () const |
Gets the value range (max) taking the significant bits into account. | |
sdata_type | getValue (const void *data) const |
Returns the value derived from a buffer data pointer mapped to the appropriate type and corrected with the results offset. | |
data_type | getValueU (const void *data) const |
Same as getValue but no offset is added. | |
sdata_type | getValue (size_type idx, const void *data) const |
Same as getValue() but now from the instance at the passed index from the array of the results type. | |
data_type | getValueU (size_type idx, const void *data) const |
Same as getValue but no offset is added. | |
id_type | getId () const |
Returns the result identifier. | |
id_type | getDesiredId () const |
Gets the desired id data member value. | |
id_type | getSequenceId () const |
Gets the sequential id of this instance. | |
std::string | getName (int levels=0) const |
Gets the result data name which is default the full result data path name. | |
int | getNameLevelCount () const |
Gets the amount of levels of the fullname path. | |
std::string | getDescription () const |
Gets the instance description. | |
void | setDesiredId () |
Sets the desired id member variable to the current reference id. | |
void | setDesiredId (id_type id) |
Sets the desired id member variable to the passed id. | |
template<typename T > | |
void | setData (T data) |
Sets the data for this instance for user purposes. | |
template<typename T = uint64_t> | |
T | getData () const |
Gets the data for this instance for user purposes Set with setData(). | |
size_type | getUsageCount () const |
Gets the usage count of this result reference. | |
const FileMappedStorage & | getDataStore () const |
Returns reference to underlying multithreaded safe storage class. | |
size_type | getBufferSize (size_type blocks) const |
Gets the size in bytes needed for buffers for reading or writing the amount of blocks. | |
size_type | getBufferSize (const Range &rng) const |
Gets the size in bytes needed for buffers for reading or writing the range. | |
size_type | getBlockSize () const |
Gets the block size in bytes. | |
Range::size_type | getBlockCount () const |
Gets the accessible block count which does not mean it is valid. | |
FileMappedStorage::size_type | getSegmentSize () const |
Gets the segment size in blocks. | |
FileMappedStorage::size_type | getSegmentCount () const |
Gets the accessible segment count. | |
FileMappedStorage::size_type | getReservedBlockCount () const |
Get the amount of reserved blocks. | |
FileMappedStorage::size_type | getReservedSize () const |
Returns the total reserved size in bytes for this instance. | |
bool | blockRead (Range::size_type ofs, Range::size_type sz, void *dest, bool force=false) const |
Reads blocks from the storage using an offset. | |
bool | blockRead (const Range &rng, void *dest, bool force=false) const |
Reads a range of blocks from storage. | |
bool | readIndexRange (Range::size_type ofs, Range &range) |
Reads a range when this instance holds indices. | |
bool | readIndexRange (const Range &index, Range &range) |
Reads a range when this instance holds indices. | |
bool | isRangeValid (Range::size_type ofs, Range::size_type sz) const |
Checks if the passed block range depicted by offset and size is valid to access/read. | |
bool | isRangeValid (const Range &rng) const |
Checks if the passed block range is valid to access/read. | |
bool | isIndexRangeValid (const Range &rng) const |
Gets if the specified index range is valid. | |
const Range & | getAccessRange () const |
Gets the accessible block range where the stop value. is the same as the result of calling 'getBlockCount'. | |
bool | getRequests (Range::Vector &requests) const |
Returns a copy of the client requests that are out for data for only the owner. | |
bool | getSplitRequests (Range::Vector &req_list) const |
Returns the ranges which are bound by the segment bounds. | |
std::ostream & | reportStatus (std::ostream &os) const |
Reports the status as in the past 'std::ostream'. | |
Range::id_type | getTransId () const |
Gets the transaction id used in requests of data. | |
bool | blockWrite (Range::size_type ofs, Range::size_type sz, const void *src, bool auto_reserve=false) |
For owners to writes data to storage in using an offset and size in blocks. | |
bool | blockWrite (const Range &rng, const void *src, bool auto_reserve=false) |
For owners to writes data to storage in using a range in blocks. | |
size_type | commitValidations (bool skip_self=false) |
Commits all validated ranges and to notifies assigned handlers. | |
bool | setReservedBlockCount (Range::size_type sz, bool skip_self=false) |
Sets the amount of blocks to reserve only for owners. | |
bool | clearValidations (bool skip_self=false) |
Clears all the valid ranges of this instance. | |
void | validateRange (Range::size_type ofs, Range::size_type sz) |
Adds a validated range of blocks for committing later. Only available for owners. | |
void | validateRange (Range rng) |
Adds a validated range of blocks for committing later. Only available for owners. | |
void | validateRange (const Range::Vector &rl) |
Like validateRange() but for a vector/list of ranges. | |
bool | requestRange (Range::size_type ofs, Range::size_type sz) |
Requests a range using offset and size in blocks to validate. | |
bool | requestRange (const Range &rng) |
Requests a range in blocks to validate. | |
bool | requestIndexRange (const Range &rng) |
Same as requestRange() but for when this instance is an index. | |
void | clearRequests () |
Clears the outstanding requests for only this instance. | |
bool | isFlag (int flag) const |
Check if a certain flag or flags (mask) are set. | |
bool | setFlag (int flag, bool skip_self) |
Sets a flag or multiple flags allowed by owners only. | |
bool | unsetFlag (int flag, bool skip_self) |
Unsets a flag or multiple flags allowed by owners only. | |
std::string | getCurFlagsString () const |
Gets the current flags as a string. | |
std::string | getFlagsString () const |
Gets the original setup flags as a string. | |
bool | updateFlags (int flag, bool skip_self) |
Sets a new set flags for this instance allowed by owners only. | |
flags_type | getFlags () const |
Gets the set of flags at setup time. | |
flags_type | getCurFlags () const |
Gets the current flags of this instance. | |
EType | getType () const |
Gets current type of the instance. | |
ResultData::size_type | getTypeSize () const |
Gets the byte size of this instance's type. | |
unsigned | getSignificantBits () const |
Gets the significant bits of the type used for this result. | |
bool | writeUpdate (std::ostream &os) const |
Writes id and current access range and current flags to the stream. | |
ResultData & | operator= (const ResultData &rd) |
Assigns the reference of the passed instance. | |
bool | operator== (const ResultData &rd) const |
Comparison operator. | |
void | operator delete (void *) |
During events no instances should be deleted. The destructor will be called but the data still exist. | |
void | setDebug (bool debug) |
Sets the debug flag for this instance reference. | |
bool | isDebug () const |
Gets the debug flag of the instance reference. | |
const ResultDataReference & | getReference () |
Gets the underlying reference class of this instance. | |
const Range::Vector & | getCommitList () const |
Gets a vector of ranges still to be committed. | |
const Range::Vector & | getValidatedList () const |
Gets a vector of ranges that are validated. | |
size_type | getSegmentLocks () const |
Returns the accumulation of locks on segments. | |
size_type | emitEvent (EEvent event, const Range &rng, bool skip_self=false) |
Initiate event for all instances of this result. If skip_self is 'true' this instance is left out of the list. | |
Public Member Functions inherited from sf::InformationBase | |
virtual | ~InformationBase ()=default |
Virtual destructor so derived classes can be destroyed by a pointer of this type. | |
Static Public Member Functions | |
static void | initialize () |
Must be called to initialize the statics which this class depends on. | |
static void | uninitialize () |
Called when terminating the application. | |
static EType | getType (const char *type) |
Gets the type from the passed string name. | |
static const char * | getType (EType type) |
Gets the string typename of the passed enumerate value. | |
static ResultData::size_type | getTypeSize (EType type) |
Gets the size of the passed enumerate type value. | |
static size_type | getCount () |
Gets the amount of references in the system. | |
static size_type | getInstanceCount () |
Gets the amount of result data instances in the system. | |
static PtrVector | getList () |
Gets a list of owner instances available. | |
static std::string | getFieldName (int field) |
Gets the name of the passed field enumerate EField. | |
static const ResultData & | getInstanceById (ResultData::id_type id) |
Gets instance with the given id otherwise the zero instance. | |
static const ResultData & | getInstanceById (id_type id, const PtrVector &list) |
Finds instance in the past vector having the passed id. | |
static const ResultData & | getInstanceBySequenceId (ResultData::id_type seq_id, const PtrVector &list) |
Finds instance in passed vector. in vector with passed sequential ID and returns a reference to it. If not found it returns ZeroResultData. | |
static ResultData::size_type | getTotalReservedSize () |
Gets the total amount of bytes reserved by all instances. | |
static bool | create (std::istream &is, PtrVector &list=null_ref< PtrVector >(), int &err_line=null_ref< int >()) |
Setup multiple instances from an input stream. | |
static bool | readUpdate (std::istream &is, bool skip_self, PtrVector &list=null_ref< PtrVector >()) |
Read new multiple current access range and current flags are read from stream. | |
static Definition | getDefinition (const std::string &str) |
static flags_type | toFlags (const std::string &flags) |
Gets flags enumerate combination of the passed flags string. | |
static std::string | getFlagsString (flags_type flags) |
Gets flags string from the passed flags passed. | |
static const char * | getEventName (EEvent event) |
Gets the name of the passed EEvent number. | |
Friends | |
class | ResultDataHandler |
class | ResultDataReference |
class | ResultDataStatic |
Additional Inherited Members | |
Public Types inherited from sf::ResultDataTypes | |
enum | EEvent : int { reNewId = -32000 , reUserGlobal , reFirstLocal = 0 , reFlagsChange , reAccessChange , reCommitted , reReserve , reInvalid , reClear , reUserLocal , reFirstPrivate = 16000 , reSetup , reIdChanged , reDesiredId , reRemove , reGetOwner , reLostOwner , reLinked , reUnlinked , reGotRange , reGetRange , reUserPrivate } |
Event enumerate values used in broadcasting where global events have a negative value. More... | |
enum | EField : int { rfId = 0 , rfName , rfFlags , rfDescription , rfType , rfBlockSize , rfSegmentSize , rfSigBits , rfOffset } |
This enumerate is the order of fields in the setup string. More... | |
enum | EType : int { rtInvalid = 0 , rtString , rtInt8 , rtInt16 , rtInt32 , rtInt64 , rtLastEntry } |
This enumerate is used to identify the type of data. More... | |
enum | EFlag : flags_type { flgRecycle = 1 << 0 , flgArchive = 1 << 1 , flgShare = 1 << 2 , flgHidden = 1 << 3 } |
Flags of the flags description field. More... | |
enum | ERangeInfo { riAvailable = 1 << 0 , riAccessible = 1 << 1 , riPartialAccessible = 1 << 2 , riRequested = 1 << 3 , riAddressable = 1 << 5 , riSegmented = 1 << 4 } |
Enumerate for range information bit values. More... | |
typedef TVector< ResultData * > | PtrVector |
Vector for pointer to results. | |
typedef TVector< ResultData > | Vector |
Vector for instances of results. | |
typedef TVector< ResultDataReference * > | ReferenceVector |
Type for internal use. | |
Public Types inherited from sf::InformationTypes | |
typedef unsigned long long | id_type |
Type used for the identifying integer (64-bits). | |
typedef int32_t | flags_type |
Type used for the flag integer. | |
typedef size_t | size_type |
Type used for size of vectors. | |
typedef uint64_t | data_type |
Type used for containing a single data element which is the largest integer. | |
typedef int64_t | sdata_type |
Type used for containing a single data element which is the largest signed integer. | |
typedef TVector< id_type > | IdVector |
Vector for lists of information ID's. | |
typedef TVector< InformationBase * > | Vector |
Vector for containing different information base derived classes. | |
Static Public Attributes inherited from sf::InformationTypes | |
static constexpr size_t | npos = std::numeric_limits<size_type>::max() |
Unsigned size value indicating not found or no index. | |
Class for creating and referencing global created data called result data. This class allows linking of member functions of other classes to handle events generated by the data server and client.
sf::ResultData::ResultData | ( | ) |
Default constructor.
|
inline |
Copy constructor.
Sets the reference as the passed instance.
rd | Instance to having the reference to assign. |
|
inlineexplicit |
Constructor for creating an instance that attaches to an existing reference by id.
id | Identifying number. |
set_desired | When true the desired id is set as the passed id. |
|
inlineexplicit |
Constructor for creating a completely new reference.
definition | Comma separated string with fields according the EField enumerate. |
id_ofs | Offset added to the id passed in the string. |
|
inlineexplicit |
Creates a new result using the passed definition structure.
definition | Definition structure. |
id_ofs | Offset given to the id. |
|
override |
Overridden destructor.
|
inline |
Reads a range of blocks from storage.
This function also calls isRangeValid() to check the validity of the data.
rng | Range of blocks to read. |
dest | Destination to write the data to. |
force | When true the function won't check the validity of the range but only the block count. |
bool sf::ResultData::blockRead | ( | Range::size_type | ofs, |
Range::size_type | sz, | ||
void * | dest, | ||
bool | force = false |
||
) | const |
Reads blocks from the storage using an offset.
This function also calls isRangeValid() to check the validity of the data.
ofs | Offset in blocks as start to read. |
sz | Size in blocks to read. |
dest | Destination to write the data to. |
force | When true the function won't check the validity of the range but only the block count. |
|
inline |
For owners to writes data to storage in using a range in blocks.
Written data needs to be committed using commitValidations() which emits the events to all event handlers.
rng | Range to write in blocks. |
src | Source pointer to data to read from. |
auto_reserve | Reserve file mapped memory when needed. |
bool sf::ResultData::blockWrite | ( | Range::size_type | ofs, |
Range::size_type | sz, | ||
const void * | src, | ||
bool | auto_reserve = false |
||
) |
For owners to writes data to storage in using an offset and size in blocks.
Written data needs to be committed using commitValidations() which emits the events to all event handlers. Passing npos as offset means that the data is appended and getBlockCount is called internally to get the offset.
ofs | When the value is npos the data is appended. |
sz | Size in blocks to write. |
src | Source pointer to data to read from. |
auto_reserve | Reserve file mapped memory when needed. |
void sf::ResultData::clearRequests | ( | ) |
Clears the outstanding requests for only this instance.
Enables making fresh start in events.
bool sf::ResultData::clearValidations | ( | bool | skip_self = false | ) |
Clears all the valid ranges of this instance.
It generates an event reClear before it is actually cleared.
skip_self | True when skipping this instance's handler. |
size_type sf::ResultData::commitValidations | ( | bool | skip_self = false | ) |
Commits all validated ranges and to notifies assigned handlers.
Emits the reCommitted event to all handlers of this instance.
skip_self | True when skipping this instance's handler. |
|
static |
Setup multiple instances from an input stream.
Useful when reading a data file.
is | Input stream definition strings. |
list | Returns vector of created instances. |
err_line | Error line number. |
Initiate event for all instances of this result. If skip_self is 'true' this instance is left out of the list.
event | |
rng | |
skip_self |
const Range & sf::ResultData::getAccessRange | ( | ) | const |
Gets the accessible block range where the stop value. is the same as the result of calling 'getBlockCount'.
Range::size_type sf::ResultData::getBlockCount | ( | ) | const |
Gets the accessible block count which does not mean it is valid.
size_type sf::ResultData::getBlockSize | ( | ) | const |
Gets the block size in bytes.
|
inline |
Gets the size in bytes needed for buffers for reading or writing the range.
rng | Range depicting the block size. |
Gets the size in bytes needed for buffers for reading or writing the amount of blocks.
blocks | Amount of blocks. |
const Range::Vector & sf::ResultData::getCommitList | ( | ) | const |
Gets a vector of ranges still to be committed.
|
static |
Gets the amount of references in the system.
In fact the amount references in the system excluding the zero one.
flags_type sf::ResultData::getCurFlags | ( | ) | const |
Gets the current flags of this instance.
std::string sf::ResultData::getCurFlagsString | ( | ) | const |
Gets the current flags as a string.
|
inline |
Gets the data for this instance for user purposes Set with setData().
const FileMappedStorage & sf::ResultData::getDataStore | ( | ) | const |
Returns reference to underlying multithreaded safe storage class.
To access the data a local data store class must be wrapped around it.
|
static |
Fills a definition structure from a string. On failure the _valid field is set to false.
str | Definition string |
std::string sf::ResultData::getDescription | ( | ) | const |
Gets the instance description.
|
inline |
Gets the desired id data member value.
|
static |
Gets the name of the passed EEvent number.
event | The event number. |
|
static |
Gets the name of the passed field enumerate EField.
flags_type sf::ResultData::getFlags | ( | ) | const |
Gets the set of flags at setup time.
std::string sf::ResultData::getFlagsString | ( | ) | const |
Gets the original setup flags as a string.
|
static |
Gets flags string from the passed flags passed.
flags | Combination of enumerate EFlag. |
|
inline |
Gets the handler pointer of this instance set with setHandler().
id_type sf::ResultData::getId | ( | ) | const |
Returns the result identifier.
|
static |
Finds instance in the past vector having the passed id.
When not found it te returns a reference to the zero instance.
id | Identifier. |
list |
|
static |
Gets instance with the given id otherwise the zero instance.
id | Identifier integer. |
|
static |
Finds instance in passed vector. in vector with passed sequential ID and returns a reference to it. If not found it returns ZeroResultData.
seq_id | |
list |
|
static |
Gets the amount of result data instances in the system.
|
static |
Gets a list of owner instances available.
Useful in populating a selection dialog.
std::string sf::ResultData::getName | ( | int | levels = 0 | ) | const |
Gets the result data name which is default the full result data path name.
When levels is 'n' and larger than zero the last 'n' levels are returned. When levels is 'n' and smaller than zero the first 'n' levels are omitted.
levels |
int sf::ResultData::getNameLevelCount | ( | ) | const |
Gets the amount of levels of the fullname path.
ResultData & sf::ResultData::getOwner | ( | ) |
Gets reference of the owning instance.
|
inline |
Gets the underlying reference class of this instance.
bool sf::ResultData::getRequests | ( | Range::Vector & | requests | ) | const |
Returns a copy of the client requests that are out for data for only the owner.
This list is already narrowed down to essential ranges.
requests | Returned ranges of outstanding current requests. |
FileMappedStorage::size_type sf::ResultData::getReservedBlockCount | ( | ) | const |
Get the amount of reserved blocks.
FileMappedStorage::size_type sf::ResultData::getReservedSize | ( | ) | const |
Returns the total reserved size in bytes for this instance.
Taking recycling into account. Don't use this to see if enough data is reserved or so.
FileMappedStorage::size_type sf::ResultData::getSegmentCount | ( | ) | const |
Gets the accessible segment count.
size_type sf::ResultData::getSegmentLocks | ( | ) | const |
Returns the accumulation of locks on segments.
FileMappedStorage::size_type sf::ResultData::getSegmentSize | ( | ) | const |
Gets the segment size in blocks.
id_type sf::ResultData::getSequenceId | ( | ) | const |
Gets the sequential id of this instance.
std::string sf::ResultData::getSetupString | ( | ) | const |
Gets the setup string for this instance.
unsigned sf::ResultData::getSignificantBits | ( | ) | const |
Gets the significant bits of the type used for this result.
bool sf::ResultData::getSplitRequests | ( | Range::Vector & | req_list | ) | const |
Returns the ranges which are bound by the segment bounds.
req_list |
|
static |
Gets the total amount of bytes reserved by all instances.
|
inline |
Gets the transaction id used in requests of data.
EType sf::ResultData::getType | ( | ) | const |
Gets current type of the instance.
|
static |
Gets the type from the passed string name.
type | String depicting a data type like 'INT32'. |
|
static |
Gets the string typename of the passed enumerate value.
type | Enumerate value. |
|
inline |
Gets the byte size of this instance's type.
|
static |
Gets the size of the passed enumerate type value.
type | Enumerate type value. |
size_type sf::ResultData::getUsageCount | ( | ) | const |
Gets the usage count of this result reference.
|
inline |
Gets the UserData void pointer data member.
const Range::Vector & sf::ResultData::getValidatedList | ( | ) | const |
Gets a vector of ranges that are validated.
sdata_type sf::ResultData::getValue | ( | const void * | data | ) | const |
Returns the value derived from a buffer data pointer mapped to the appropriate type and corrected with the results offset.
data | Pointer to element. |
sdata_type sf::ResultData::getValue | ( | size_type | idx, |
const void * | data | ||
) | const |
Same as getValue() but now from the instance at the passed index from the array of the results type.
idx | Index offset into the data. |
data | Pointer to element. |
data_type sf::ResultData::getValueOffset | ( | ) | const |
Returns the correction offset for each value to get the real value.
data_type sf::ResultData::getValueRange | ( | ) | const |
Gets the value range (max) taking the significant bits into account.
data_type sf::ResultData::getValueU | ( | const void * | data | ) | const |
Same as getValue but no offset is added.
data | Pointer to element. |
Same as getValue but no offset is added.
idx | |
data |
|
static |
Must be called to initialize the statics which this class depends on.
|
inline |
Gets the debug flag of the instance reference.
bool sf::ResultData::isFlag | ( | int | flag | ) | const |
Check if a certain flag or flags (mask) are set.
flag | One or a combination of flags. |
bool sf::ResultData::isIndexRangeValid | ( | const Range & | rng | ) | const |
Gets if the specified index range is valid.
rng | Index range being validated. |
bool sf::ResultData::isOwner | ( | ) | const |
Checks if this is the owner of this result.
bool sf::ResultData::isRangeValid | ( | const Range & | rng | ) | const |
Checks if the passed block range is valid to access/read.
rng | Range in blocks. |
bool sf::ResultData::isRangeValid | ( | Range::size_type | ofs, |
Range::size_type | sz | ||
) | const |
Checks if the passed block range depicted by offset and size is valid to access/read.
ofs | Offset in blocks. |
sz | Size in blocks. |
bool sf::ResultData::isValid | ( | ) | const |
Gets the instance validity.
void sf::ResultData::makeOwner | ( | ) |
Make this instance owner of this result.
void sf::ResultData::operator delete | ( | void * | ) |
During events no instances should be deleted. The destructor will be called but the data still exist.
|
inline |
Assigns the reference of the passed instance.
Calls actually setup(const ResultData& rd).
rd | Source instance |
|
inline |
Comparison operator.
rd | Result data to compare. |
Reads a range when this instance holds indices.
index | Range pointing to the first index and the last index value to read. |
range | Resulting range that was read. |
bool sf::ResultData::readIndexRange | ( | Range::size_type | ofs, |
Range & | range | ||
) |
Reads a range when this instance holds indices.
An index instance groups blocks together for processing/imaging purposes.
ofs | Offset in the storage container to read the index range. |
range | Resulting range that was read. |
|
static |
Read new multiple current access range and current flags are read from stream.
Used in communication between applications.
is | Input stream. |
skip_self | When true no events are send to this instance itself. |
list | Optional other list to use as source for instances. |
std::ostream & sf::ResultData::reportStatus | ( | std::ostream & | os | ) | const |
Reports the status as in the past 'std::ostream'.
bool sf::ResultData::requestIndexRange | ( | const Range & | rng | ) |
Same as requestRange() but for when this instance is an index.
rng | Requested index range. |
bool sf::ResultData::requestRange | ( | const Range & | rng | ) |
Requests a range in blocks to validate.
rng | Range in blocks. |
|
inline |
Requests a range using offset and size in blocks to validate.
Emits event reGetRange to the owner when a handler is assigned to it. Returns false when the request was rejected by the range manager due to being already valid or when the range is not within the current accessible range.
ofs | Offset in blocks. |
sz | Size in blocks. |
bool sf::ResultData::setAccessRange | ( | const Range & | rng, |
bool | skip_self = false |
||
) |
Sets the accessible range.
When needed the method calls setReservedBlockCount() to match the given range emitting the reReserve event. When the range is increased an reAccessChange event is emitted.
rng | Accessible range in blocks. |
skip_self | True when skipping this instance's handler. |
|
inline |
Same as setAccessRange where the start value is default 0.
stop | End of range in blocks. |
skip_self | True when skipping this instance's handler. |
|
inline |
Sets the data for this instance for user purposes.
data | Could be a pointer cast value. |
void sf::ResultData::setDebug | ( | bool | debug | ) |
Sets the debug flag for this instance reference.
debug | True to enable. |
void sf::ResultData::setDesiredId | ( | ) |
Sets the desired id member variable to the current reference id.
void sf::ResultData::setDesiredId | ( | id_type | id | ) |
Sets the desired id member variable to the passed id.
If the passed 'id' is zero the automatic attachment mechanism is disabled.
id | DesiredId |
bool sf::ResultData::setFlag | ( | int | flag, |
bool | skip_self | ||
) |
Sets a flag or multiple flags allowed by owners only.
flag | One or a combination of flags. |
skip_self | True when skipping this instance's handler. |
void sf::ResultData::setHandler | ( | ResultDataHandler * | handler | ) |
Sets an event handler for this instance.
handler | Passing NULL will disable the link. |
bool sf::ResultData::setReservedBlockCount | ( | Range::size_type | sz, |
bool | skip_self = false |
||
) |
Sets the amount of blocks to reserve only for owners.
This method is called underwater when 'auto_reserve' is true in a call to blockWrite(). Emits event reReserve to all instance handlers.
sz | Blocks to reserve. |
skip_self | True when skipping this instance's handler. |
bool sf::ResultData::setup | ( | const Definition & | definition, |
id_type | id_ofs | ||
) |
Creates a new TResultDataReference from a structure for this instance.
definition | Definition structure. |
id_ofs | Offset given to the definition id. |
|
inline |
Sets reference as the reference in the past instance.
rd | Instance to get the source reference from. |
|
inline |
Creates a new reference from a setup string for this instance.
definition | Comma separated string with fields according the EField enumerate. |
id_ofs | Offset for the id in the definition string. |
|
inline |
Sets reference to other by id.
The global list of references is searched for the passed id and referenced when found. When found event reIdChanged is emitted. When the desired id was set and changed the reDesiredId event is emitted. Cannot be used for local variables.
id | Identifier. |
set_did | When true the desired id is set to the passed 'id'. |
|
inline |
Sets the void pointer data member for general purposes to cast in a handler.
data | Pointer |
|
static |
Gets flags enumerate combination of the passed flags string.
flags | Flags string. |
|
static |
Called when terminating the application.
bool sf::ResultData::unsetFlag | ( | int | flag, |
bool | skip_self | ||
) |
Unsets a flag or multiple flags allowed by owners only.
flag | One or a combination of flags. |
skip_self | True when skipping this instance's handler. |
bool sf::ResultData::updateFlags | ( | int | flag, |
bool | skip_self | ||
) |
Sets a new set flags for this instance allowed by owners only.
flag | One or a combination of flags. |
skip_self | True when skipping this instance's handler. |
void sf::ResultData::validateRange | ( | const Range::Vector & | rl | ) |
Like validateRange() but for a vector/list of ranges.
rl | List of ranges. |
void sf::ResultData::validateRange | ( | Range | rng | ) |
Adds a validated range of blocks for committing later. Only available for owners.
This method is useful when file mapped storage is written when locking it in memory when not using method blockWrite() which implies this.
rng | Range blocks. |
|
inline |
Adds a validated range of blocks for committing later. Only available for owners.
This method is useful when file mapped storage is written when locking it in memory when not using method blockWrite() which implies this.
ofs | Offset in blocks. |
sz | Size in blocks. |
bool sf::ResultData::writeUpdate | ( | std::ostream & | os | ) | const |
Writes id and current access range and current flags to the stream.
Used in communication between applications.
os | Output stream. |
|
friend |
|
friend |
|
friend |