Scanframe Modular Application 0.1.0
|
Script object for exporting GII parameters to a script object. More...
#include <ResultDataScriptObject.h>
Public Member Functions | |
ResultDataScriptObject (const Parameters ¶ms) | |
std::string | getStatusText () override |
Gets the status text of this object for debugging purposes. | |
Public Member Functions inherited from sf::ScriptObject | |
ScriptObject (const char *type_name, ScriptObject *parent=nullptr) | |
virtual | ~ScriptObject ()=default |
Virtual destructor which can be overloaded to clean up objects. | |
int | getRefCount () const |
Gets the reference count. | |
operator Value () const | |
Cast operator to be able to return this instance as a Value. | |
std::string | getTypeName () const |
Returns the type name Set at the constructor. | |
ScriptObject * | getParent () |
Gets the script object owner. | |
const ScriptObject * | getParent () const |
Gets the script object owner. | |
ScriptObject * | castToObject (const Value &value) |
Casts a sf::Value::vitCustom typed sf::Value to a ScriptObject typed pointer. | |
Public Member Functions inherited from sf::ResultData | |
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. | |
Protected Member Functions | |
const IdInfo * | getInfo (const std::string &name) const override |
Must be overloaded for member namespace. | |
void | destroyObject (bool &should_delete) override |
Asks if the object should be deleted after having made this call. | |
bool | getSetValue (const IdInfo *info, Value *value, Value::vector_type *params, bool flag_set) override |
Gets or sets the a passed data member. Must be overloaded in derived class. | |
Protected Member Functions inherited from sf::ScriptObject | |
void | makeParent (ScriptObject *so) |
Makes this object the owner of the other object. | |
void | setParent (ScriptObject *parent) |
Sets the owner to the pass script object. | |
Additional Inherited Members | |
Public Types inherited from sf::ScriptObject | |
enum | EIdentifier { idUnknown = 0 , idConstant , idVariable , idFunction , idTypedef , idKeyword } |
Keyword identifiers. More... | |
typedef std::string::size_type | pos_type |
Source position type. | |
typedef ssize_t | ip_type |
Instruction pointer type. | |
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 Member Functions inherited from sf::ScriptObject | |
static const IdInfo * | getInfoUnknown () |
Returns the static Info structure for unknowns. | |
static sf::TClassRegistration< ScriptObject, ScriptObject::Parameters > | Interface () |
Static Public Member Functions inherited from sf::ResultData | |
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. | |
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. | |
Script object for exporting GII parameters to a script object.
|
explicit |
|
inlineoverrideprotectedvirtual |
Asks if the object should be deleted after having made this call.
Implements sf::ScriptObject.
|
overrideprotectedvirtual |
Must be overloaded for member namespace.
Implements sf::ScriptObject.
|
overrideprotectedvirtual |
Gets or sets the a passed data member. Must be overloaded in derived class.
Implements sf::ScriptObject.
|
overridevirtual |
Gets the status text of this object for debugging purposes.
Reimplemented from sf::ScriptObject.