From a5e34c0ae1f92d35634634cd7e652da8b3efa965 Mon Sep 17 00:00:00 2001 From: 0x17 <0x17@users.noreply.github.com> Date: Tue, 21 May 2024 05:56:35 +0000 Subject: [PATCH] deploy: 2598d2628326b249795d1e29f6e854bbbf0fab41 --- classgdx_1_1TAcronymList-members.html | 4 +- classgdx_1_1TAcronymList.html | 12 +- classgdx_1_1TGXFileObj.html | 12 +- classgdx_1_1TUELTable-members.html | 4 +- classgdx_1_1TUELTable.html | 12 +- gdx_8h_source.html | 208 ++++----- gxfile_8h_source.html | 622 +++++++++++++------------- index.html | 49 +- structgdx_1_1TAcronym-members.html | 4 +- structgdx_1_1TAcronym.html | 12 +- structgdx_1_1TgdxSymbRecord.html | 6 +- 11 files changed, 481 insertions(+), 464 deletions(-) diff --git a/classgdx_1_1TAcronymList-members.html b/classgdx_1_1TAcronymList-members.html index e4a01c9e..254d1701 100644 --- a/classgdx_1_1TAcronymList-members.html +++ b/classgdx_1_1TAcronymList-members.html @@ -102,10 +102,10 @@ CheckEntry(int Map) (defined in gdx::TAcronymList)gdx::TAcronymList FindEntry(int Map) (defined in gdx::TAcronymList)gdx::TAcronymList FindName(const char *Name) (defined in gdx::TAcronymList)gdx::TAcronymList - LoadFromStream(gdlib::gmsstrm::TXStreamDelphi &S) (defined in gdx::TAcronymList)gdx::TAcronymList + LoadFromStream(gdlib::gmsstrm::TXStream &S) (defined in gdx::TAcronymList)gdx::TAcronymList MemoryUsed() (defined in gdx::TAcronymList)gdx::TAcronymList operator[](int Index) (defined in gdx::TAcronymList)gdx::TAcronymList - SaveToStream(gdlib::gmsstrm::TXStreamDelphi &S) (defined in gdx::TAcronymList)gdx::TAcronymList + SaveToStream(gdlib::gmsstrm::TXStream &S) (defined in gdx::TAcronymList)gdx::TAcronymList size() const (defined in gdx::TAcronymList)gdx::TAcronymListinline TAcronymList()=default (defined in gdx::TAcronymList)gdx::TAcronymList ~TAcronymList() (defined in gdx::TAcronymList)gdx::TAcronymList diff --git a/classgdx_1_1TAcronymList.html b/classgdx_1_1TAcronymList.html index b43e6e38..7f238226 100644 --- a/classgdx_1_1TAcronymList.html +++ b/classgdx_1_1TAcronymList.html @@ -113,12 +113,12 @@ void CheckEntry (int Map)   - -void SaveToStream (gdlib::gmsstrm::TXStreamDelphi &S) -  - -void LoadFromStream (gdlib::gmsstrm::TXStreamDelphi &S) -  + +void SaveToStream (gdlib::gmsstrm::TXStream &S) +  + +void LoadFromStream (gdlib::gmsstrm::TXStream &S) +  int MemoryUsed ()   diff --git a/classgdx_1_1TGXFileObj.html b/classgdx_1_1TGXFileObj.html index b8760d1e..f6ba55a5 100644 --- a/classgdx_1_1TGXFileObj.html +++ b/classgdx_1_1TGXFileObj.html @@ -105,12 +105,12 @@ - - +

Public Types

enum class  TraceLevels { trl_none +
enum class  TraceLevels : uint8_t { trl_none , trl_errors , trl_some , trl_all }
 
 
@@ -2719,7 +2719,7 @@

std::cout << "Get domain count = " << cnt << std::endl;
pgx.gdxGetDomainElements(1, 1, 7, DataDomainCB, cnt);
-
int gdxDataErrorCount() const
Query the number of error records.
Definition: gxfile.cpp:2133
+
int gdxDataErrorCount() const
Query the number of error records.
Definition: gxfile.cpp:2134
See also
gdxDataErrorRecord
@@ -3033,7 +3033,7 @@

if(ErrCode) {
[ ... ]
}
-
int gdxOpenAppend(const char *FileName, const char *Producer, int &ErrNr)
Open an existing GDX file for output. Non-zero if the file can be opened, zero otherwise.
Definition: gxfile.cpp:3424
+
int gdxOpenAppend(const char *FileName, const char *Producer, int &ErrNr)
Open an existing GDX file for output. Non-zero if the file can be opened, zero otherwise.
Definition: gxfile.cpp:3425
See also
gdxOpenRead, gdxOpenWrite, gdxOpenWriteEx
@@ -3079,7 +3079,7 @@

if(ErrNr) {
[...]
}
-
int gdxOpenRead(const char *FileName, int &ErrNr)
Open a GDX file for reading. Non-zero if the file can be opened, zero otherwise.
Definition: gxfile.cpp:1720
+
int gdxOpenRead(const char *FileName, int &ErrNr)
Open a GDX file for reading. Non-zero if the file can be opened, zero otherwise.
Definition: gxfile.cpp:1721
See also
gdxOpenWrite, gdxGetLastError
@@ -3243,7 +3243,7 @@

if(ErrCode) {
[ ... ]
}
-
int gdxOpenWriteEx(const char *FileName, const char *Producer, int Compr, int &ErrNr)
Create a GDX file for writing with explicitly given compression flag. Non-zero if the file can be ope...
Definition: gxfile.cpp:396
+
int gdxOpenWriteEx(const char *FileName, const char *Producer, int Compr, int &ErrNr)
Create a GDX file for writing with explicitly given compression flag. Non-zero if the file can be ope...
Definition: gxfile.cpp:397
See also
gdxOpenRead, gdxOpenWrite, gdxAutoConvert
diff --git a/classgdx_1_1TUELTable-members.html b/classgdx_1_1TUELTable-members.html index 20cf75c9..cf52ab49 100644 --- a/classgdx_1_1TUELTable-members.html +++ b/classgdx_1_1TUELTable-members.html @@ -106,13 +106,13 @@

- + - + diff --git a/classgdx_1_1TUELTable.html b/classgdx_1_1TUELTable.html index 2ccc4911..0bd42bda 100644 --- a/classgdx_1_1TUELTable.html +++ b/classgdx_1_1TUELTable.html @@ -150,12 +150,12 @@ - - - - + + + + diff --git a/gdx_8h_source.html b/gdx_8h_source.html index 2e3e5774..11cc4e14 100644 --- a/gdx_8h_source.html +++ b/gdx_8h_source.html @@ -136,7 +136,7 @@
45
51 ~TGXFileObj();
52
-
53 enum class TraceLevels
+
53 enum class TraceLevels : uint8_t
54 {
55 trl_none,
56 trl_errors,
@@ -386,9 +386,9 @@
1745
1746
1747private:
-
1748std::unique_ptr<gdlib::gmsstrm::TMiBufferedStreamDelphi> FFile;
+
1748std::unique_ptr<gdlib::gmsstrm::TMiBufferedStream> FFile;
1749TgxFileMode fmode { f_not_open }, fmode_AftReg { f_not_open };
-
1750enum
+
1750enum : uint8_t
1751{
1752 stat_notopen,
1753 stat_read,
@@ -496,107 +496,107 @@
1855
1856}// namespace gdx
gdx::TGXFileObj
Definition: gdx.h:37
-
gdx::TGXFileObj::gdxDataReadRawFastFilt
int gdxDataReadRawFastFilt(int SyNr, const char **UelFilterStr, TDataStoreFiltProc_t DP)
Read a symbol in Raw mode while applying a filter using a callback procedure. Returns zero if the ope...
Definition: gxfile.cpp:3600
-
gdx::TGXFileObj::gdxErrorStr
static int gdxErrorStr(int ErrNr, char *ErrMsg)
Returns the text for a given error number. Always non-zero.
Definition: gxfile.cpp:1713
-
gdx::TGXFileObj::gdxSymbolAddComment
int gdxSymbolAddComment(int SyNr, const char *Txt)
Add a line of comment text for a symbol. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3515
-
gdx::TGXFileObj::gdxAcronymGetInfo
int gdxAcronymGetInfo(int N, char *AName, char *Txt, int &AIndx) const
Retrieve acronym information from the acronym table. Non-zero if the index into the acronym table is ...
Definition: gxfile.cpp:2958
-
gdx::TGXFileObj::gdxDataWriteRaw
int gdxDataWriteRaw(const int *KeyInt, const double *Values)
Write a data element in raw mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2199
-
gdx::TGXFileObj::gdxOpenReadEx
int gdxOpenReadEx(const char *FileName, int ReadMode, int &ErrNr)
Open a GDX file for reading allowing for skipping sections. Non-zero if the file can be opened,...
Definition: gxfile.cpp:2687
-
gdx::TGXFileObj::gdxDataReadFilteredStart
int gdxDataReadFilteredStart(int SyNr, const int *FilterAction, int &NrRecs)
Initialize the reading of a symbol in filtered mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3087
-
gdx::TGXFileObj::gdxSymbolGetComment
int gdxSymbolGetComment(int SyNr, int N, char *Txt)
Retrieve a line of comment text for a symbol. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3534
-
gdx::TGXFileObj::gdxSetTraceLevel
int gdxSetTraceLevel(int N, const char *s)
Set the amount of trace (debug) information generated. Always non-zero.
Definition: gxfile.cpp:3180
-
gdx::TGXFileObj::gdxAddSetText
int gdxAddSetText(const char *Txt, int &TxtNr)
Register a string in the string table Register a string in the string table and return the integer nu...
Definition: gxfile.cpp:2119
-
gdx::TGXFileObj::gdxUELRegisterStrStart
int gdxUELRegisterStrStart()
Start registering unique elements in string mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2620
-
gdx::TGXFileObj::gdxDataWriteStr
int gdxDataWriteStr(const char **KeyStr, const double *Values)
Write a data element in string mode. Each element string must follow the GAMS rules for unique elemen...
Definition: gxfile.cpp:471
-
gdx::TGXFileObj::gdxUMUelInfo
int gdxUMUelInfo(int &UelCnt, int &HighMap) const
Return information about the unique elements (UELs). Always non-zero.
Definition: gxfile.cpp:2645
-
gdx::TGXFileObj::gdxMapAcronymsToNaN
int gdxMapAcronymsToNaN() const
Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default.
Definition: gxfile.cpp:3590
-
gdx::TGXFileObj::gdxFilterRegisterStart
int gdxFilterRegisterStart(int FilterNr)
Define a unique element filter. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3035
-
gdx::TGXFileObj::gdxUELRegisterMapStart
int gdxUELRegisterMapStart()
Start registering unique elements in mapped mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2747
-
gdx::TGXFileObj::gdxGetDLLVersion
static int gdxGetDLLVersion(char *V)
Returns a version descriptor of the library. Always non-zero.
Definition: gxfile.cpp:3258
-
gdx::TGXFileObj::gdxGetMemoryUsed
int64_t gdxGetMemoryUsed()
Return the number of bytes used by the data objects.
Definition: gxfile.cpp:3391
-
gdx::TGXFileObj::gdxSymbolGetDomainX
int gdxSymbolGetDomainX(int SyNr, char **DomainIDs)
Retrieve the domain of a symbol (using relaxed or domain information). Returns zero if the operation ...
Definition: gxfile.cpp:2364
-
gdx::TGXFileObj::gdxSetTextNodeNr
int gdxSetTextNodeNr(int TxtNr, int Node)
Set the Node number for an entry in the string table. After registering a string with AddSetText,...
Definition: gxfile.cpp:3093
-
gdx::TGXFileObj::gdxAcronymValue
double gdxAcronymValue(int AIndx) const
Create an acronym value based on the index (AIndx should be greater than 0). Returns the calculated a...
Definition: gxfile.cpp:3246
-
gdx::TGXFileObj::gdxDataReadRawFast
int gdxDataReadRawFast(int SyNr, TDataStoreProc_t DP, int &NrRecs)
Read a symbol in Raw mode using a callback procedure. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3653
-
gdx::TGXFileObj::gdxGetLastError
int gdxGetLastError()
Returns the last error number or zero if there was no error. Calling this function will clear the las...
Definition: gxfile.cpp:2260
-
gdx::TGXFileObj::gdxDataWriteRawStart
int gdxDataWriteRawStart(const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo)
Start writing a new symbol in raw mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2207
-
gdx::TGXFileObj::gdxRenameUEL
int gdxRenameUEL(const char *OldName, const char *NewName)
Rename unique element OldName to NewName.
Definition: gxfile.cpp:2665
-
gdx::TGXFileObj::gdxDataErrorRecord
int gdxDataErrorRecord(int RecNr, int *KeyInt, double *Values)
Retrieve an error record. Non-zero if the record number is valid.
Definition: gxfile.cpp:2138
-
gdx::TGXFileObj::gdxSymbolSetDomain
int gdxSymbolSetDomain(const char **DomainIDs)
Define the domain of a symbol for which a write data operation just started using DataWriteRawStart,...
Definition: gxfile.cpp:2442
-
gdx::TGXFileObj::gdxSymbolSetDomainX
int gdxSymbolSetDomainX(int SyNr, const char **DomainIDs)
Define the domain of a symbol (relaxed version). Returns zero if the operation is not possible.
Definition: gxfile.cpp:2533
-
gdx::TGXFileObj::gdxOpenWriteEx
int gdxOpenWriteEx(const char *FileName, const char *Producer, int Compr, int &ErrNr)
Create a GDX file for writing with explicitly given compression flag. Non-zero if the file can be ope...
Definition: gxfile.cpp:396
-
gdx::TGXFileObj::gdxUELRegisterRaw
int gdxUELRegisterRaw(const char *Uel)
Register unique element in raw mode. This can only be used while writing to a GDX file....
Definition: gxfile.cpp:2584
-
gdx::TGXFileObj::gdxMapValue
int gdxMapValue(double D, int &sv)
Classify a value as a potential special value. Non-zero if D is a special value, zero otherwise.
Definition: gxfile.cpp:3404
-
gdx::TGXFileObj::gdxGetDomainElements
int gdxGetDomainElements(int SyNr, int DimPos, int FilterNr, TDomainIndexProc_t DP, int &NrElem, void *Uptr)
Get the unique elements for a given dimension of a given symbol.
Definition: gxfile.cpp:3105
-
gdx::TGXFileObj::gdxOpenRead
int gdxOpenRead(const char *FileName, int &ErrNr)
Open a GDX file for reading. Non-zero if the file can be opened, zero otherwise.
Definition: gxfile.cpp:1720
-
gdx::TGXFileObj::gdxStoreDomainSets
int gdxStoreDomainSets() const
Get flag to store one dimensional sets as potential domains, false (0) saves lots of space for large ...
Definition: gxfile.cpp:3570
-
gdx::TGXFileObj::gdxOpenAppend
int gdxOpenAppend(const char *FileName, const char *Producer, int &ErrNr)
Open an existing GDX file for output. Non-zero if the file can be opened, zero otherwise.
Definition: gxfile.cpp:3424
-
gdx::TGXFileObj::gdxStoreDomainSetsSet
void gdxStoreDomainSetsSet(int flag)
Set flag to store one dimensional sets as potential domains, false (0) saves lots of space for large ...
Definition: gxfile.cpp:3575
-
gdx::TGXFileObj::gdxUELRegisterStr
int gdxUELRegisterStr(const char *Uel, int &UelNr)
Register a unique element in string mode. A unique element must follow the GAMS rules when it contain...
Definition: gxfile.cpp:2608
-
gdx::TGXFileObj::gdxDataWriteStrStart
int gdxDataWriteStrStart(const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo)
Start writing a new symbol in string mode. Returns zero if the operation is not possible or failed.
Definition: gxfile.cpp:461
-
gdx::TGXFileObj::gdxUELMaxLength
int gdxUELMaxLength() const
Returns the length of the longest unique element (UEL) name.
Definition: gxfile.cpp:3549
-
gdx::TGXFileObj::gdxResetSpecialValues
int gdxResetSpecialValues()
Reset the internal values for special values. Always non-zero.
Definition: gxfile.cpp:690
-
gdx::TGXFileObj::gdxDataErrorRecordX
int gdxDataErrorRecordX(int RecNr, int *KeyInt, double *Values)
Retrieve an error record. Non-zero if the record number is valid.
Definition: gxfile.cpp:2151
-
gdx::TGXFileObj::gdxAcronymName
int gdxAcronymName(double V, char *AName)
Find the name of an acronym value. Non-zero if a name for the acronym is defined. An unnamed acronym ...
Definition: gxfile.cpp:3232
-
gdx::TGXFileObj::gdxSymbolDim
int gdxSymbolDim(int SyNr)
Returns dimensionality of a symbol.
Definition: gxfile.cpp:2411
-
gdx::TGXFileObj::gdxDataWriteMapStart
int gdxDataWriteMapStart(const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo)
Start writing a new symbol in mapped mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2706
-
gdx::TGXFileObj::gdxFileVersion
int gdxFileVersion(char *FileStr, char *ProduceStr) const
Return strings for file version and file producer. Always non-zero.
Definition: gxfile.cpp:1725
-
gdx::TGXFileObj::gdxDataReadSliceStart
int gdxDataReadSliceStart(int SyNr, int *ElemCounts)
Prepare for the reading of a slice of data from a data set. The actual read of the data is done by ca...
Definition: gxfile.cpp:3283
-
gdx::TGXFileObj::gdxAcronymNextNr
int gdxAcronymNextNr(int NV)
Returns the value of the NextAutoAcronym variable and sets the variable to nv.
Definition: gxfile.cpp:3010
-
gdx::TGXFileObj::gdxDataReadStr
int gdxDataReadStr(char **KeyStr, double *Values, int &DimFrst)
Read the next record using strings for the unique elements. The reading should be initialized by call...
Definition: gxfile.cpp:1747
-
gdx::TGXFileObj::gdxDataWriteDone
int gdxDataWriteDone()
Finish a write operation. Returns zero if the operation is not possible.
Definition: gxfile.cpp:507
-
gdx::TGXFileObj::gdxDataReadRaw
int gdxDataReadRaw(int *KeyInt, double *Values, int &DimFrst)
Read the next record in raw mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2171
-
gdx::TGXFileObj::gdxDataReadMapStart
int gdxDataReadMapStart(int SyNr, int &NrRecs)
Initialize the reading of a symbol in mapped mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2772
-
gdx::TGXFileObj::gdxDataSliceUELS
int gdxDataSliceUELS(const int *SliceKeyInt, char **KeyStr)
Map a slice index in to the corresponding unique elements. After calling DataReadSliceStart,...
Definition: gxfile.cpp:3368
-
gdx::TGXFileObj::gdxClose
int gdxClose()
Close a GDX file that was previously opened for reading or writing. Before the file is closed,...
Definition: gxfile.cpp:532
-
gdx::TGXFileObj::gdxDataReadRawStart
int gdxDataReadRawStart(int SyNr, int &NrRecs)
Initialize the reading of a symbol in raw mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2192
-
gdx::TGXFileObj::gdxDataWriteRawStartKeyBounds
int gdxDataWriteRawStartKeyBounds(const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo, const int *MinUELIndices, const int *MaxUELIndices)
Start writing a new symbol in raw mode with bounds for UEL key indices being known in advance....
Definition: gxfile.cpp:2219
-
gdx::TGXFileObj::gdxUMUelGet
int gdxUMUelGet(int UelNr, char *Uel, int &UelMap)
Get a unique element using an unmapped index. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2629
-
gdx::TGXFileObj::gdxAllowBogusDomains
int gdxAllowBogusDomains() const
Get flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomain...
Definition: gxfile.cpp:3580
-
gdx::TGXFileObj::gdxSymbolInfo
int gdxSymbolInfo(int SyNr, char *SyId, int &Dimen, int &Typ)
Returns information (name, dimension count, type) about a symbol from the symbol table....
Definition: gxfile.cpp:1814
-
gdx::TGXFileObj::gdxUELRegisterMap
int gdxUELRegisterMap(int UMap, const char *Uel)
Register unique element in mapped mode. A unique element must follow the GAMS rules when it contains ...
Definition: gxfile.cpp:2756
-
gdx::TGXFileObj::gdxDataWriteMap
int gdxDataWriteMap(const int *KeyInt, const double *Values)
Write a data element in mapped mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2714
-
gdx::TGXFileObj::gdxSystemInfo
int gdxSystemInfo(int &SyCnt, int &UelCnt) const
Returns the number of symbols and unique elements. Always non-zero.
Definition: gxfile.cpp:2569
-
gdx::TGXFileObj::gdxDataReadDone
int gdxDataReadDone()
Finish reading of a symbol in any mode (raw, mapped, string). . Returns zero if the operation is not ...
Definition: gxfile.cpp:1776
-
gdx::TGXFileObj::gdxFilterRegister
int gdxFilterRegister(int UelMap)
Add a unique element to the current filter definition, zero if the index number is out of range or wa...
Definition: gxfile.cpp:3045
-
gdx::TGXFileObj::gdxAcronymIndex
int gdxAcronymIndex(double V) const
Get index value of an acronym. Returns zero if V does not represent an acronym.
Definition: gxfile.cpp:3227
-
gdx::TGXFileObj::gdxAcronymAdd
int gdxAcronymAdd(const char *AName, const char *Txt, int AIndx)
Add a new acronym entry. This can be used to add entries before data is written. Returns negative val...
Definition: gxfile.cpp:3208
-
gdx::TGXFileObj::gdxDataReadSlice
int gdxDataReadSlice(const char **UelFilterStr, int &Dimen, TDataStoreProc_t DP)
Read a slice of data from a data set, by fixing zero or more index positions in the data....
Definition: gxfile.cpp:3324
-
gdx::TGXFileObj::gdxSetSpecialValues
int gdxSetSpecialValues(const double *AVals)
Set the internal values for special values. Before calling this function, initialize the array of spe...
Definition: gxfile.cpp:2301
-
gdx::TGXFileObj::gdxDataErrorCount
int gdxDataErrorCount() const
Query the number of error records.
Definition: gxfile.cpp:2133
-
gdx::TGXFileObj::gdxSymbMaxLength
int gdxSymbMaxLength() const
Returns the length of the longest symbol name in the GDX file.
Definition: gxfile.cpp:3507
-
gdx::TGXFileObj::gdxDataReadMap
int gdxDataReadMap(int RecNr, int *KeyInt, double *Values, int &DimFrst)
Read the next record in mapped mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2779
-
gdx::TGXFileObj::gdxFilterRegisterDone
int gdxFilterRegisterDone()
Finish registration of unique elements for a filter. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3062
-
gdx::TGXFileObj::gdxUMFindUEL
int gdxUMFindUEL(const char *Uel, int &UelNr, int &UelMap)
Search for unique element by its string. Non-zero if the element was found, zero otherwise.
Definition: gxfile.cpp:3554
-
gdx::TGXFileObj::gdxFilterExists
int gdxFilterExists(int FilterNr)
Check if there is a filter defined based on its number as used in gdxFilterRegisterStart....
Definition: gxfile.cpp:3029
-
gdx::TGXFileObj::gdxDataReadRawFastEx
int gdxDataReadRawFastEx(int SyNr, TDataStoreExProc_t DP, int &NrRecs, void *Uptr)
Read a symbol in Raw mode using a callback procedure. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3665
-
gdx::TGXFileObj::gdxFindSymbol
int gdxFindSymbol(const char *SyId, int &SyNr)
Search for a symbol by name in the symbol table; the search is not case-sensitive.
Definition: gxfile.cpp:1732
-
gdx::TGXFileObj::gdxSetReadSpecialValues
int gdxSetReadSpecialValues(const double *AVals)
Set the internal values for special values when reading a GDX file. Before calling this function,...
Definition: gxfile.cpp:3448
-
gdx::TGXFileObj::gdxAddAlias
int gdxAddAlias(const char *Id1, const char *Id2)
Add an alias for a set to the symbol table. One of the two identifiers has to be a known set,...
Definition: gxfile.cpp:2079
-
gdx::TGXFileObj::gdxGetSpecialValues
int gdxGetSpecialValues(double *AVals)
Retrieve the internal values for special values. Always non-zero.
Definition: gxfile.cpp:2280
-
gdx::TGXFileObj::gdxAllowBogusDomainsSet
void gdxAllowBogusDomainsSet(int flag)
Set flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomain...
Definition: gxfile.cpp:3585
-
gdx::TGXFileObj::~TGXFileObj
~TGXFileObj()
Dispose GDX file object.
Definition: gxfile.cpp:681
-
gdx::TGXFileObj::gdxGetUEL
int gdxGetUEL(int UelNr, char *Uel) const
Get the string for a unique element using a mapped index. Returns zero if the operation is not possib...
Definition: gxfile.cpp:2692
-
gdx::TGXFileObj::gdxSymbolGetDomain
int gdxSymbolGetDomain(int SyNr, int *DomainSyNrs)
Retrieve the domain of a symbol. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2355
-
gdx::TGXFileObj::gdxAcronymCount
int gdxAcronymCount() const
Number of entries in the acronym table.
Definition: gxfile.cpp:2953
-
gdx::TGXFileObj::gdxGetElemText
int gdxGetElemText(int TxtNr, char *Txt, int &Node)
Retrieve the string and node number for an entry in the string table. Returns zero if the operation i...
Definition: gxfile.cpp:2236
-
gdx::TGXFileObj::gdxAcronymGetMapping
int gdxAcronymGetMapping(int N, int &orgIndx, int &newIndx, int &autoIndex)
Get information how acronym values are remapped. When reading GDX data, we need to map indices for ac...
Definition: gxfile.cpp:3017
-
gdx::TGXFileObj::gdxCurrentDim
int gdxCurrentDim() const
Returns the dimension of the currently active symbol When reading or writing data,...
Definition: gxfile.cpp:2660
-
gdx::TGXFileObj::gdxSymbolInfoX
int gdxSymbolInfoX(int SyNr, int &RecCnt, int &UserInfo, char *ExplTxt)
Returns additional information about a symbol. Returns zero if the symbol number is out of range,...
Definition: gxfile.cpp:2417
-
gdx::TGXFileObj::gdxAutoConvert
int gdxAutoConvert(int NV)
Returns the value of the AutoConvert variable and sets the variable to nv. When we close a new GDX fi...
Definition: gxfile.cpp:3251
-
gdx::TGXFileObj::gdxSetHasText
int gdxSetHasText(int SyNr)
Test if any of the elements of the set has an associated text. Non-zero if the Set contains at least ...
Definition: gxfile.cpp:3443
-
gdx::TGXFileObj::gdxErrorCount
int gdxErrorCount() const
Returns the number of errors.
Definition: gxfile.cpp:2231
-
gdx::TGXFileObj::gdxOpenWrite
int gdxOpenWrite(const char *FileName, const char *Producer, int &ErrNr)
Open a new GDX file for output. Non-zero if the file can be opened, zero otherwise.
Definition: gxfile.cpp:391
-
gdx::TGXFileObj::gdxUELRegisterDone
int gdxUELRegisterDone()
Finish registration of unique elements. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2576
-
gdx::TGXFileObj::gdxFileInfo
int gdxFileInfo(int &FileVer, int &ComprLev) const
Returns file format number and compression level used. Always non-zero.
Definition: gxfile.cpp:3264
-
gdx::TGXFileObj::gdxDataReadStrStart
int gdxDataReadStrStart(int SyNr, int &NrRecs)
Initialize the reading of a symbol in string mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:1840
-
gdx::TGXFileObj::gdxMapAcronymsToNaNSet
void gdxMapAcronymsToNaNSet(int flag)
Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default.
Definition: gxfile.cpp:3595
-
gdx::TGXFileObj::gdxUELRegisterRawStart
int gdxUELRegisterRawStart()
Start registering unique elements in raw mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2600
-
gdx::TGXFileObj::gdxSymbIndxMaxLength
int gdxSymbIndxMaxLength(int SyNr, int *LengthInfo)
Returns the length of the longest UEL used for every index position for a given symbol.
Definition: gxfile.cpp:3472
-
gdx::TGXFileObj::gdxAcronymSetInfo
int gdxAcronymSetInfo(int N, const char *AName, const char *Txt, int AIndx)
Modify acronym information in the acronym table.
Definition: gxfile.cpp:2973
-
gdx::TgxModeSet
Definition: gxfile.h:185
-
gdx::TDFilter
Definition: gxfile.h:81
-
gdx::TgdxSymbRecord
Definition: gxfile.h:128
+
gdx::TGXFileObj::gdxDataReadRawFastFilt
int gdxDataReadRawFastFilt(int SyNr, const char **UelFilterStr, TDataStoreFiltProc_t DP)
Read a symbol in Raw mode while applying a filter using a callback procedure. Returns zero if the ope...
Definition: gxfile.cpp:3601
+
gdx::TGXFileObj::gdxErrorStr
static int gdxErrorStr(int ErrNr, char *ErrMsg)
Returns the text for a given error number. Always non-zero.
Definition: gxfile.cpp:1714
+
gdx::TGXFileObj::gdxSymbolAddComment
int gdxSymbolAddComment(int SyNr, const char *Txt)
Add a line of comment text for a symbol. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3516
+
gdx::TGXFileObj::gdxAcronymGetInfo
int gdxAcronymGetInfo(int N, char *AName, char *Txt, int &AIndx) const
Retrieve acronym information from the acronym table. Non-zero if the index into the acronym table is ...
Definition: gxfile.cpp:2959
+
gdx::TGXFileObj::gdxDataWriteRaw
int gdxDataWriteRaw(const int *KeyInt, const double *Values)
Write a data element in raw mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2200
+
gdx::TGXFileObj::gdxOpenReadEx
int gdxOpenReadEx(const char *FileName, int ReadMode, int &ErrNr)
Open a GDX file for reading allowing for skipping sections. Non-zero if the file can be opened,...
Definition: gxfile.cpp:2688
+
gdx::TGXFileObj::gdxDataReadFilteredStart
int gdxDataReadFilteredStart(int SyNr, const int *FilterAction, int &NrRecs)
Initialize the reading of a symbol in filtered mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3088
+
gdx::TGXFileObj::gdxSymbolGetComment
int gdxSymbolGetComment(int SyNr, int N, char *Txt)
Retrieve a line of comment text for a symbol. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3535
+
gdx::TGXFileObj::gdxSetTraceLevel
int gdxSetTraceLevel(int N, const char *s)
Set the amount of trace (debug) information generated. Always non-zero.
Definition: gxfile.cpp:3181
+
gdx::TGXFileObj::gdxAddSetText
int gdxAddSetText(const char *Txt, int &TxtNr)
Register a string in the string table Register a string in the string table and return the integer nu...
Definition: gxfile.cpp:2120
+
gdx::TGXFileObj::gdxUELRegisterStrStart
int gdxUELRegisterStrStart()
Start registering unique elements in string mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2621
+
gdx::TGXFileObj::gdxDataWriteStr
int gdxDataWriteStr(const char **KeyStr, const double *Values)
Write a data element in string mode. Each element string must follow the GAMS rules for unique elemen...
Definition: gxfile.cpp:472
+
gdx::TGXFileObj::gdxUMUelInfo
int gdxUMUelInfo(int &UelCnt, int &HighMap) const
Return information about the unique elements (UELs). Always non-zero.
Definition: gxfile.cpp:2646
+
gdx::TGXFileObj::gdxMapAcronymsToNaN
int gdxMapAcronymsToNaN() const
Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default.
Definition: gxfile.cpp:3591
+
gdx::TGXFileObj::gdxFilterRegisterStart
int gdxFilterRegisterStart(int FilterNr)
Define a unique element filter. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3036
+
gdx::TGXFileObj::gdxUELRegisterMapStart
int gdxUELRegisterMapStart()
Start registering unique elements in mapped mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2748
+
gdx::TGXFileObj::gdxGetDLLVersion
static int gdxGetDLLVersion(char *V)
Returns a version descriptor of the library. Always non-zero.
Definition: gxfile.cpp:3259
+
gdx::TGXFileObj::gdxGetMemoryUsed
int64_t gdxGetMemoryUsed()
Return the number of bytes used by the data objects.
Definition: gxfile.cpp:3392
+
gdx::TGXFileObj::gdxSymbolGetDomainX
int gdxSymbolGetDomainX(int SyNr, char **DomainIDs)
Retrieve the domain of a symbol (using relaxed or domain information). Returns zero if the operation ...
Definition: gxfile.cpp:2365
+
gdx::TGXFileObj::gdxSetTextNodeNr
int gdxSetTextNodeNr(int TxtNr, int Node)
Set the Node number for an entry in the string table. After registering a string with AddSetText,...
Definition: gxfile.cpp:3094
+
gdx::TGXFileObj::gdxAcronymValue
double gdxAcronymValue(int AIndx) const
Create an acronym value based on the index (AIndx should be greater than 0). Returns the calculated a...
Definition: gxfile.cpp:3247
+
gdx::TGXFileObj::gdxDataReadRawFast
int gdxDataReadRawFast(int SyNr, TDataStoreProc_t DP, int &NrRecs)
Read a symbol in Raw mode using a callback procedure. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3654
+
gdx::TGXFileObj::gdxGetLastError
int gdxGetLastError()
Returns the last error number or zero if there was no error. Calling this function will clear the las...
Definition: gxfile.cpp:2261
+
gdx::TGXFileObj::gdxDataWriteRawStart
int gdxDataWriteRawStart(const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo)
Start writing a new symbol in raw mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2208
+
gdx::TGXFileObj::gdxRenameUEL
int gdxRenameUEL(const char *OldName, const char *NewName)
Rename unique element OldName to NewName.
Definition: gxfile.cpp:2666
+
gdx::TGXFileObj::gdxDataErrorRecord
int gdxDataErrorRecord(int RecNr, int *KeyInt, double *Values)
Retrieve an error record. Non-zero if the record number is valid.
Definition: gxfile.cpp:2139
+
gdx::TGXFileObj::gdxSymbolSetDomain
int gdxSymbolSetDomain(const char **DomainIDs)
Define the domain of a symbol for which a write data operation just started using DataWriteRawStart,...
Definition: gxfile.cpp:2443
+
gdx::TGXFileObj::gdxSymbolSetDomainX
int gdxSymbolSetDomainX(int SyNr, const char **DomainIDs)
Define the domain of a symbol (relaxed version). Returns zero if the operation is not possible.
Definition: gxfile.cpp:2534
+
gdx::TGXFileObj::gdxOpenWriteEx
int gdxOpenWriteEx(const char *FileName, const char *Producer, int Compr, int &ErrNr)
Create a GDX file for writing with explicitly given compression flag. Non-zero if the file can be ope...
Definition: gxfile.cpp:397
+
gdx::TGXFileObj::gdxUELRegisterRaw
int gdxUELRegisterRaw(const char *Uel)
Register unique element in raw mode. This can only be used while writing to a GDX file....
Definition: gxfile.cpp:2585
+
gdx::TGXFileObj::gdxMapValue
int gdxMapValue(double D, int &sv)
Classify a value as a potential special value. Non-zero if D is a special value, zero otherwise.
Definition: gxfile.cpp:3405
+
gdx::TGXFileObj::gdxGetDomainElements
int gdxGetDomainElements(int SyNr, int DimPos, int FilterNr, TDomainIndexProc_t DP, int &NrElem, void *Uptr)
Get the unique elements for a given dimension of a given symbol.
Definition: gxfile.cpp:3106
+
gdx::TGXFileObj::gdxOpenRead
int gdxOpenRead(const char *FileName, int &ErrNr)
Open a GDX file for reading. Non-zero if the file can be opened, zero otherwise.
Definition: gxfile.cpp:1721
+
gdx::TGXFileObj::gdxStoreDomainSets
int gdxStoreDomainSets() const
Get flag to store one dimensional sets as potential domains, false (0) saves lots of space for large ...
Definition: gxfile.cpp:3571
+
gdx::TGXFileObj::gdxOpenAppend
int gdxOpenAppend(const char *FileName, const char *Producer, int &ErrNr)
Open an existing GDX file for output. Non-zero if the file can be opened, zero otherwise.
Definition: gxfile.cpp:3425
+
gdx::TGXFileObj::gdxStoreDomainSetsSet
void gdxStoreDomainSetsSet(int flag)
Set flag to store one dimensional sets as potential domains, false (0) saves lots of space for large ...
Definition: gxfile.cpp:3576
+
gdx::TGXFileObj::gdxUELRegisterStr
int gdxUELRegisterStr(const char *Uel, int &UelNr)
Register a unique element in string mode. A unique element must follow the GAMS rules when it contain...
Definition: gxfile.cpp:2609
+
gdx::TGXFileObj::gdxDataWriteStrStart
int gdxDataWriteStrStart(const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo)
Start writing a new symbol in string mode. Returns zero if the operation is not possible or failed.
Definition: gxfile.cpp:462
+
gdx::TGXFileObj::gdxUELMaxLength
int gdxUELMaxLength() const
Returns the length of the longest unique element (UEL) name.
Definition: gxfile.cpp:3550
+
gdx::TGXFileObj::gdxResetSpecialValues
int gdxResetSpecialValues()
Reset the internal values for special values. Always non-zero.
Definition: gxfile.cpp:691
+
gdx::TGXFileObj::gdxDataErrorRecordX
int gdxDataErrorRecordX(int RecNr, int *KeyInt, double *Values)
Retrieve an error record. Non-zero if the record number is valid.
Definition: gxfile.cpp:2152
+
gdx::TGXFileObj::gdxAcronymName
int gdxAcronymName(double V, char *AName)
Find the name of an acronym value. Non-zero if a name for the acronym is defined. An unnamed acronym ...
Definition: gxfile.cpp:3233
+
gdx::TGXFileObj::gdxSymbolDim
int gdxSymbolDim(int SyNr)
Returns dimensionality of a symbol.
Definition: gxfile.cpp:2412
+
gdx::TGXFileObj::gdxDataWriteMapStart
int gdxDataWriteMapStart(const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo)
Start writing a new symbol in mapped mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2707
+
gdx::TGXFileObj::gdxFileVersion
int gdxFileVersion(char *FileStr, char *ProduceStr) const
Return strings for file version and file producer. Always non-zero.
Definition: gxfile.cpp:1726
+
gdx::TGXFileObj::gdxDataReadSliceStart
int gdxDataReadSliceStart(int SyNr, int *ElemCounts)
Prepare for the reading of a slice of data from a data set. The actual read of the data is done by ca...
Definition: gxfile.cpp:3284
+
gdx::TGXFileObj::gdxAcronymNextNr
int gdxAcronymNextNr(int NV)
Returns the value of the NextAutoAcronym variable and sets the variable to nv.
Definition: gxfile.cpp:3011
+
gdx::TGXFileObj::gdxDataReadStr
int gdxDataReadStr(char **KeyStr, double *Values, int &DimFrst)
Read the next record using strings for the unique elements. The reading should be initialized by call...
Definition: gxfile.cpp:1748
+
gdx::TGXFileObj::gdxDataWriteDone
int gdxDataWriteDone()
Finish a write operation. Returns zero if the operation is not possible.
Definition: gxfile.cpp:508
+
gdx::TGXFileObj::gdxDataReadRaw
int gdxDataReadRaw(int *KeyInt, double *Values, int &DimFrst)
Read the next record in raw mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2172
+
gdx::TGXFileObj::gdxDataReadMapStart
int gdxDataReadMapStart(int SyNr, int &NrRecs)
Initialize the reading of a symbol in mapped mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2773
+
gdx::TGXFileObj::gdxDataSliceUELS
int gdxDataSliceUELS(const int *SliceKeyInt, char **KeyStr)
Map a slice index in to the corresponding unique elements. After calling DataReadSliceStart,...
Definition: gxfile.cpp:3369
+
gdx::TGXFileObj::gdxClose
int gdxClose()
Close a GDX file that was previously opened for reading or writing. Before the file is closed,...
Definition: gxfile.cpp:533
+
gdx::TGXFileObj::gdxDataReadRawStart
int gdxDataReadRawStart(int SyNr, int &NrRecs)
Initialize the reading of a symbol in raw mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2193
+
gdx::TGXFileObj::gdxDataWriteRawStartKeyBounds
int gdxDataWriteRawStartKeyBounds(const char *SyId, const char *ExplTxt, int Dimen, int Typ, int UserInfo, const int *MinUELIndices, const int *MaxUELIndices)
Start writing a new symbol in raw mode with bounds for UEL key indices being known in advance....
Definition: gxfile.cpp:2220
+
gdx::TGXFileObj::gdxUMUelGet
int gdxUMUelGet(int UelNr, char *Uel, int &UelMap)
Get a unique element using an unmapped index. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2630
+
gdx::TGXFileObj::gdxAllowBogusDomains
int gdxAllowBogusDomains() const
Get flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomain...
Definition: gxfile.cpp:3581
+
gdx::TGXFileObj::gdxSymbolInfo
int gdxSymbolInfo(int SyNr, char *SyId, int &Dimen, int &Typ)
Returns information (name, dimension count, type) about a symbol from the symbol table....
Definition: gxfile.cpp:1815
+
gdx::TGXFileObj::gdxUELRegisterMap
int gdxUELRegisterMap(int UMap, const char *Uel)
Register unique element in mapped mode. A unique element must follow the GAMS rules when it contains ...
Definition: gxfile.cpp:2757
+
gdx::TGXFileObj::gdxDataWriteMap
int gdxDataWriteMap(const int *KeyInt, const double *Values)
Write a data element in mapped mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2715
+
gdx::TGXFileObj::gdxSystemInfo
int gdxSystemInfo(int &SyCnt, int &UelCnt) const
Returns the number of symbols and unique elements. Always non-zero.
Definition: gxfile.cpp:2570
+
gdx::TGXFileObj::gdxDataReadDone
int gdxDataReadDone()
Finish reading of a symbol in any mode (raw, mapped, string). . Returns zero if the operation is not ...
Definition: gxfile.cpp:1777
+
gdx::TGXFileObj::gdxFilterRegister
int gdxFilterRegister(int UelMap)
Add a unique element to the current filter definition, zero if the index number is out of range or wa...
Definition: gxfile.cpp:3046
+
gdx::TGXFileObj::gdxAcronymIndex
int gdxAcronymIndex(double V) const
Get index value of an acronym. Returns zero if V does not represent an acronym.
Definition: gxfile.cpp:3228
+
gdx::TGXFileObj::gdxAcronymAdd
int gdxAcronymAdd(const char *AName, const char *Txt, int AIndx)
Add a new acronym entry. This can be used to add entries before data is written. Returns negative val...
Definition: gxfile.cpp:3209
+
gdx::TGXFileObj::gdxDataReadSlice
int gdxDataReadSlice(const char **UelFilterStr, int &Dimen, TDataStoreProc_t DP)
Read a slice of data from a data set, by fixing zero or more index positions in the data....
Definition: gxfile.cpp:3325
+
gdx::TGXFileObj::gdxSetSpecialValues
int gdxSetSpecialValues(const double *AVals)
Set the internal values for special values. Before calling this function, initialize the array of spe...
Definition: gxfile.cpp:2302
+
gdx::TGXFileObj::gdxDataErrorCount
int gdxDataErrorCount() const
Query the number of error records.
Definition: gxfile.cpp:2134
+
gdx::TGXFileObj::gdxSymbMaxLength
int gdxSymbMaxLength() const
Returns the length of the longest symbol name in the GDX file.
Definition: gxfile.cpp:3508
+
gdx::TGXFileObj::gdxDataReadMap
int gdxDataReadMap(int RecNr, int *KeyInt, double *Values, int &DimFrst)
Read the next record in mapped mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2780
+
gdx::TGXFileObj::gdxFilterRegisterDone
int gdxFilterRegisterDone()
Finish registration of unique elements for a filter. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3063
+
gdx::TGXFileObj::gdxUMFindUEL
int gdxUMFindUEL(const char *Uel, int &UelNr, int &UelMap)
Search for unique element by its string. Non-zero if the element was found, zero otherwise.
Definition: gxfile.cpp:3555
+
gdx::TGXFileObj::gdxFilterExists
int gdxFilterExists(int FilterNr)
Check if there is a filter defined based on its number as used in gdxFilterRegisterStart....
Definition: gxfile.cpp:3030
+
gdx::TGXFileObj::gdxDataReadRawFastEx
int gdxDataReadRawFastEx(int SyNr, TDataStoreExProc_t DP, int &NrRecs, void *Uptr)
Read a symbol in Raw mode using a callback procedure. Returns zero if the operation is not possible.
Definition: gxfile.cpp:3666
+
gdx::TGXFileObj::gdxFindSymbol
int gdxFindSymbol(const char *SyId, int &SyNr)
Search for a symbol by name in the symbol table; the search is not case-sensitive.
Definition: gxfile.cpp:1733
+
gdx::TGXFileObj::gdxSetReadSpecialValues
int gdxSetReadSpecialValues(const double *AVals)
Set the internal values for special values when reading a GDX file. Before calling this function,...
Definition: gxfile.cpp:3449
+
gdx::TGXFileObj::gdxAddAlias
int gdxAddAlias(const char *Id1, const char *Id2)
Add an alias for a set to the symbol table. One of the two identifiers has to be a known set,...
Definition: gxfile.cpp:2080
+
gdx::TGXFileObj::gdxGetSpecialValues
int gdxGetSpecialValues(double *AVals)
Retrieve the internal values for special values. Always non-zero.
Definition: gxfile.cpp:2281
+
gdx::TGXFileObj::gdxAllowBogusDomainsSet
void gdxAllowBogusDomainsSet(int flag)
Set flag to ignore using 1-dim sets as domain when their elements are not tracked (see gdxStoreDomain...
Definition: gxfile.cpp:3586
+
gdx::TGXFileObj::~TGXFileObj
~TGXFileObj()
Dispose GDX file object.
Definition: gxfile.cpp:682
+
gdx::TGXFileObj::gdxGetUEL
int gdxGetUEL(int UelNr, char *Uel) const
Get the string for a unique element using a mapped index. Returns zero if the operation is not possib...
Definition: gxfile.cpp:2693
+
gdx::TGXFileObj::gdxSymbolGetDomain
int gdxSymbolGetDomain(int SyNr, int *DomainSyNrs)
Retrieve the domain of a symbol. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2356
+
gdx::TGXFileObj::gdxAcronymCount
int gdxAcronymCount() const
Number of entries in the acronym table.
Definition: gxfile.cpp:2954
+
gdx::TGXFileObj::gdxGetElemText
int gdxGetElemText(int TxtNr, char *Txt, int &Node)
Retrieve the string and node number for an entry in the string table. Returns zero if the operation i...
Definition: gxfile.cpp:2237
+
gdx::TGXFileObj::gdxAcronymGetMapping
int gdxAcronymGetMapping(int N, int &orgIndx, int &newIndx, int &autoIndex)
Get information how acronym values are remapped. When reading GDX data, we need to map indices for ac...
Definition: gxfile.cpp:3018
+
gdx::TGXFileObj::gdxCurrentDim
int gdxCurrentDim() const
Returns the dimension of the currently active symbol When reading or writing data,...
Definition: gxfile.cpp:2661
+
gdx::TGXFileObj::gdxSymbolInfoX
int gdxSymbolInfoX(int SyNr, int &RecCnt, int &UserInfo, char *ExplTxt)
Returns additional information about a symbol. Returns zero if the symbol number is out of range,...
Definition: gxfile.cpp:2418
+
gdx::TGXFileObj::gdxAutoConvert
int gdxAutoConvert(int NV)
Returns the value of the AutoConvert variable and sets the variable to nv. When we close a new GDX fi...
Definition: gxfile.cpp:3252
+
gdx::TGXFileObj::gdxSetHasText
int gdxSetHasText(int SyNr)
Test if any of the elements of the set has an associated text. Non-zero if the Set contains at least ...
Definition: gxfile.cpp:3444
+
gdx::TGXFileObj::gdxErrorCount
int gdxErrorCount() const
Returns the number of errors.
Definition: gxfile.cpp:2232
+
gdx::TGXFileObj::gdxOpenWrite
int gdxOpenWrite(const char *FileName, const char *Producer, int &ErrNr)
Open a new GDX file for output. Non-zero if the file can be opened, zero otherwise.
Definition: gxfile.cpp:392
+
gdx::TGXFileObj::gdxUELRegisterDone
int gdxUELRegisterDone()
Finish registration of unique elements. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2577
+
gdx::TGXFileObj::gdxFileInfo
int gdxFileInfo(int &FileVer, int &ComprLev) const
Returns file format number and compression level used. Always non-zero.
Definition: gxfile.cpp:3265
+
gdx::TGXFileObj::gdxDataReadStrStart
int gdxDataReadStrStart(int SyNr, int &NrRecs)
Initialize the reading of a symbol in string mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:1841
+
gdx::TGXFileObj::gdxMapAcronymsToNaNSet
void gdxMapAcronymsToNaNSet(int flag)
Flag to map all acronym values to the GAMS "Not a Number" special value. Disabled by default.
Definition: gxfile.cpp:3596
+
gdx::TGXFileObj::gdxUELRegisterRawStart
int gdxUELRegisterRawStart()
Start registering unique elements in raw mode. Returns zero if the operation is not possible.
Definition: gxfile.cpp:2601
+
gdx::TGXFileObj::gdxSymbIndxMaxLength
int gdxSymbIndxMaxLength(int SyNr, int *LengthInfo)
Returns the length of the longest UEL used for every index position for a given symbol.
Definition: gxfile.cpp:3473
+
gdx::TGXFileObj::gdxAcronymSetInfo
int gdxAcronymSetInfo(int N, const char *AName, const char *Txt, int AIndx)
Modify acronym information in the acronym table.
Definition: gxfile.cpp:2974
+
gdx::TgxModeSet
Definition: gxfile.h:183
+
gdx::TDFilter
Definition: gxfile.h:79
+
gdx::TgdxSymbRecord
Definition: gxfile.h:126
diff --git a/gxfile_8h_source.html b/gxfile_8h_source.html index 904365e2..50cec747 100644 --- a/gxfile_8h_source.html +++ b/gxfile_8h_source.html @@ -139,331 +139,329 @@
42#include <memory> // for unique_ptr, allocator
43#include <optional> // for optional
44#include <string> // for string
-
45#include <string_view> // for string_view
-
46
-
47namespace gdlib::gmsstrm
-
48{
-
49class TMiBufferedStreamDelphi;
-
50class TXStreamDelphi;
-
51}// namespace gdx::gmsstrm
+
45
+
46namespace gdlib::gmsstrm
+
47{
+
48class TXStream;
+
49}// namespace gdx::gmsstrm
+
50
+
51//======================================================================================================================
52
-
53//======================================================================================================================
-
54
-
55namespace gdx
-
56{
-
57
-
58using TgdxUELIndex = std::array<int, GMS_MAX_INDEX_DIM>;
-
59using TgdxValues = std::array<double, GMS_VAL_SCALE + 1>;
-
60
-
61using TDomainIndexProc_t = void ( * )( int RawIndex, int MappedIndex, void *Uptr );
-
62using TDataStoreProc_t = void ( * )( const int *Indx, const double *Vals );
-
63using TDataStoreFiltProc_t = int ( * )( const int *Indx, const double *Vals, void *Uptr );
-
64using TDataStoreExProc_t = int ( * )( const int *Indx, const double *Vals, const int afdim, void *Uptr );
-
65
-
66using TDataStoreExProc_F = int ( * )( const int *Indx, const double *Vals, const int afdim, int64_t Uptr );
-
67using TDataStoreFiltProc_F = int ( * )( const int *Indx, const double *Vals, int64_t Uptr );
-
68using TDomainIndexProc_F = void ( * )( int RawIndex, int MappedIndex, int64_t Uptr );
+
53namespace gdx
+
54{
+
55
+
56using TgdxUELIndex = std::array<int, GMS_MAX_INDEX_DIM>;
+
57using TgdxValues = std::array<double, GMS_VAL_SCALE + 1>;
+
58
+
59using TDomainIndexProc_t = void ( * )( int RawIndex, int MappedIndex, void *Uptr );
+
60using TDataStoreProc_t = void ( * )( const int *Indx, const double *Vals );
+
61using TDataStoreFiltProc_t = int ( * )( const int *Indx, const double *Vals, void *Uptr );
+
62using TDataStoreExProc_t = int ( * )( const int *Indx, const double *Vals, const int afdim, void *Uptr );
+
63
+
64using TDataStoreExProc_F = int ( * )( const int *Indx, const double *Vals, const int afdim, int64_t Uptr );
+
65using TDataStoreFiltProc_F = int ( * )( const int *Indx, const double *Vals, int64_t Uptr );
+
66using TDomainIndexProc_F = void ( * )( int RawIndex, int MappedIndex, int64_t Uptr );
+
67
+
68const std::array<int, GMS_DT_ALIAS + 1> DataTypSize { 1, 1, 5, 5, 0 };
69
-
70const std::array<int, GMS_DT_ALIAS + 1> DataTypSize { 1, 1, 5, 5, 0 };
-
71
-
72constexpr int DOMC_UNMAPPED = -2,// indicator for unmapped index pos
-
73 DOMC_EXPAND = -1, // indicator growing index pos
-
74 DOMC_STRICT = 0; // indicator mapped index pos
-
75
-
76const std::string BADUEL_PREFIX = "?L__",
-
77 BADStr_PREFIX = "?Str__",
-
78 strGDXCOMPRESS = "GDXCOMPRESS",
-
79 strGDXCONVERT = "GDXCONVERT";
-
80
-
81struct TDFilter {
-
82 int FiltNumber {}, FiltMaxUel {};
-
83 gdlib::gmsobj::TBooleanBitArray FiltMap {};
-
84 bool FiltSorted {};
-
85
-
86 TDFilter( int Nr, int UserHigh ) : FiltNumber { Nr },
-
87 FiltMaxUel { UserHigh }
-
88 {
-
89 }
+
70constexpr int DOMC_UNMAPPED = -2,// indicator for unmapped index pos
+
71 DOMC_EXPAND = -1, // indicator growing index pos
+
72 DOMC_STRICT = 0; // indicator mapped index pos
+
73
+
74const std::string BADUEL_PREFIX = "?L__",
+
75 BADStr_PREFIX = "?Str__",
+
76 strGDXCOMPRESS = "GDXCOMPRESS",
+
77 strGDXCONVERT = "GDXCONVERT";
+
78
+
79struct TDFilter {
+
80 int FiltNumber {}, FiltMaxUel {};
+
81 gdlib::gmsobj::TBooleanBitArray FiltMap {};
+
82 bool FiltSorted {};
+
83
+
84 TDFilter( int Nr, int UserHigh ) : FiltNumber { Nr },
+
85 FiltMaxUel { UserHigh }
+
86 {
+
87 }
+
88
+
89 ~TDFilter() = default;
90
-
91 ~TDFilter() = default;
-
92
-
93 [[nodiscard]] int MemoryUsed() const
-
94 {
-
95 return FiltMap.MemoryUsed();
-
96 }
-
97
-
98 [[nodiscard]] bool InFilter( int V ) const
-
99 {
-
100 return V >= 0 && V <= FiltMaxUel && FiltMap.GetBit( V );
-
101 }
-
102
-
103 void SetFilter( int ix, bool v )
-
104 {
-
105 FiltMap.SetBit( ix, v );
-
106 }
-
107};
+
91 [[nodiscard]] int MemoryUsed() const
+
92 {
+
93 return FiltMap.MemoryUsed();
+
94 }
+
95
+
96 [[nodiscard]] bool InFilter( int V ) const
+
97 {
+
98 return V >= 0 && V <= FiltMaxUel && FiltMap.GetBit( V );
+
99 }
+
100
+
101 void SetFilter( int ix, bool v )
+
102 {
+
103 FiltMap.SetBit( ix, v );
+
104 }
+
105};
+
106
+
107using TSetBitMap = gdlib::gmsobj::TBooleanBitArray;
108
-
109using TSetBitMap = gdlib::gmsobj::TBooleanBitArray;
-
110
-
111enum class TgdxDAction
-
112{
-
113 dm_unmapped,
-
114 dm_strict,
-
115 dm_filter,
-
116 dm_expand
-
117};
-
118
-
119struct TDomain {
-
120 TDFilter *DFilter;
-
121 TgdxDAction DAction;
-
122};
+
109enum class TgdxDAction : uint8_t
+
110{
+
111 dm_unmapped,
+
112 dm_strict,
+
113 dm_filter,
+
114 dm_expand
+
115};
+
116
+
117struct TDomain {
+
118 TDFilter *DFilter;
+
119 TgdxDAction DAction;
+
120};
+
121
+
122using TDomainList = std::array<TDomain, GLOBAL_MAX_INDEX_DIM>;
123
-
124using TDomainList = std::array<TDomain, GLOBAL_MAX_INDEX_DIM>;
+
124using TCommentsList = gdlib::gmsobj::TXStrings;
125
-
126using TCommentsList = gdlib::gmsobj::TXStrings;
-
127
-
128struct TgdxSymbRecord {
-
129 int SSyNr;
-
130 int64_t SPosition;
-
131 int SDim, SDataCount, SErrors;
-
132 gdxSyType SDataType;
-
133 int SUserInfo;
-
134 bool SSetText;
-
135 std::array<char, GMS_SSSIZE> SExplTxt;
-
136 bool SIsCompressed;
-
137 std::unique_ptr<int[]> SDomSymbols,// real domain info
-
138 SDomStrings; // relaxed domain info
-
139 std::optional<TCommentsList> SCommentsList;
-
140 bool SScalarFrst; // not stored
-
141 std::unique_ptr<TSetBitMap> SSetBitMap;// for 1-dim sets only
-
142};
-
143using PgdxSymbRecord = TgdxSymbRecord *;
-
144
-
145enum TgdxIntlValTyp
-
146{// values stored internally via the indicator byte
-
147 vm_valund,
-
148 vm_valna,
-
149 vm_valpin,
-
150 vm_valmin,
-
151 vm_valeps,
-
152 vm_zero,
-
153 vm_one,
-
154 vm_mone,
-
155 vm_half,
-
156 vm_two,
-
157 vm_normal,
-
158 vm_count
-
159};
-
160
-
161enum TgxFileMode
-
162{
-
163 f_not_open,
-
164 fr_init,
-
165 fw_init,
-
166 fw_dom_raw,
-
167 fw_dom_map,
-
168 fw_dom_str,
-
169 fw_raw_data,
-
170 fw_map_data,
-
171 fw_str_data,
-
172 f_raw_elem,
-
173 f_map_elem,
-
174 f_str_elem,
-
175 fr_raw_data,
-
176 fr_map_data,
-
177 fr_mapr_data,
-
178 fr_str_data,
-
179 fr_filter,
-
180 fr_slice,
-
181 tgxfilemode_count
-
182};
-
183
-
184class TgxModeSet : public utils::IContainsPredicate<TgxFileMode>
-
185{
-
186 std::array<bool, tgxfilemode_count> modeActive {};
-
187 uint8_t count {};
-
188
-
189public:
-
190 TgxModeSet( const std::initializer_list<TgxFileMode> &modes );
-
191 ~TgxModeSet() override = default;
-
192 [[nodiscard]] bool contains( const TgxFileMode &mode ) const override;
-
193 [[nodiscard]] bool empty() const;
-
194};
-
195
-
196const TgxModeSet AnyWriteMode { fw_init, fw_dom_raw, fw_dom_map, fw_dom_str, fw_raw_data, fw_map_data, fw_str_data },
-
197 AnyReadMode { fr_init, fr_raw_data, fr_map_data, fr_mapr_data, fr_str_data };
-
198
-
199enum class TgdxElemSize
-
200{
-
201 sz_byte,
-
202 sz_word,
-
203 sz_integer
-
204};
-
205
-
206// N.B.: we store integers in [0..high(integer)] in TIntegerMapping, so
-
207// FMAXCAPACITY = high(integer) + 1 is all we will ever need, and we will
-
208// never get a request to grow any larger. The checks and code
-
209// in growMapping reflect this
-
210class TIntegerMapping
-
211{
-
212 int64_t FCapacity {}, FMapBytes {};
-
213 int64_t FMAXCAPACITY { std::numeric_limits<int>::max() + static_cast<int64_t>( 1 ) };
-
214 int FHighestIndex {};
-
215 int *PMap {};
+
126struct TgdxSymbRecord {
+
127 int SSyNr;
+
128 int64_t SPosition;
+
129 int SDim, SDataCount, SErrors;
+
130 gdxSyType SDataType;
+
131 int SUserInfo;
+
132 bool SSetText;
+
133 std::array<char, GMS_SSSIZE> SExplTxt;
+
134 bool SIsCompressed;
+
135 bool SScalarFrst; // not stored
+
136 std::unique_ptr<int[]> SDomSymbols,// real domain info
+
137 SDomStrings;// relaxed domain info
+
138 std::optional<TCommentsList> SCommentsList;
+
139 std::unique_ptr<TSetBitMap> SSetBitMap;// for 1-dim sets only
+
140};
+
141using PgdxSymbRecord = TgdxSymbRecord *;
+
142
+
143enum TgdxIntlValTyp : uint8_t
+
144{// values stored internally via the indicator byte
+
145 vm_valund,
+
146 vm_valna,
+
147 vm_valpin,
+
148 vm_valmin,
+
149 vm_valeps,
+
150 vm_zero,
+
151 vm_one,
+
152 vm_mone,
+
153 vm_half,
+
154 vm_two,
+
155 vm_normal,
+
156 vm_count
+
157};
+
158
+
159enum TgxFileMode : uint8_t
+
160{
+
161 f_not_open,
+
162 fr_init,
+
163 fw_init,
+
164 fw_dom_raw,
+
165 fw_dom_map,
+
166 fw_dom_str,
+
167 fw_raw_data,
+
168 fw_map_data,
+
169 fw_str_data,
+
170 f_raw_elem,
+
171 f_map_elem,
+
172 f_str_elem,
+
173 fr_raw_data,
+
174 fr_map_data,
+
175 fr_mapr_data,
+
176 fr_str_data,
+
177 fr_filter,
+
178 fr_slice,
+
179 tgxfilemode_count
+
180};
+
181
+
182class TgxModeSet : public utils::IContainsPredicate<TgxFileMode>
+
183{
+
184 std::array<bool, tgxfilemode_count> modeActive {};
+
185 uint8_t count {};
+
186
+
187public:
+
188 TgxModeSet( const std::initializer_list<TgxFileMode> &modes );
+
189 ~TgxModeSet() override = default;
+
190 [[nodiscard]] bool contains( const TgxFileMode &mode ) const override;
+
191 [[nodiscard]] bool empty() const;
+
192};
+
193
+
194const TgxModeSet AnyWriteMode { fw_init, fw_dom_raw, fw_dom_map, fw_dom_str, fw_raw_data, fw_map_data, fw_str_data },
+
195 AnyReadMode { fr_init, fr_raw_data, fr_map_data, fr_mapr_data, fr_str_data };
+
196
+
197enum class TgdxElemSize : uint8_t
+
198{
+
199 sz_byte,
+
200 sz_word,
+
201 sz_integer
+
202};
+
203
+
204// N.B.: we store integers in [0..high(integer)] in TIntegerMapping, so
+
205// FMAXCAPACITY = high(integer) + 1 is all we will ever need, and we will
+
206// never get a request to grow any larger. The checks and code
+
207// in growMapping reflect this
+
208class TIntegerMapping
+
209{
+
210 int64_t FCapacity {}, FMapBytes {};
+
211 int64_t FMAXCAPACITY { std::numeric_limits<int>::max() + static_cast<int64_t>( 1 ) };
+
212 int FHighestIndex {};
+
213 int *PMap {};
+
214
+
215 void growMapping( int F );
216
-
217 void growMapping( int F );
-
218
-
219public:
-
220 TIntegerMapping() = default;
-
221 ~TIntegerMapping();
-
222 [[nodiscard]] int MemoryUsed() const;
-
223 [[nodiscard]] int GetHighestIndex() const;
-
224 [[nodiscard]] int GetMapping( int F ) const;
-
225 void SetMapping( int F, int T );
-
226 [[nodiscard]] int size() const;
-
227 [[nodiscard]] bool empty() const;
-
228 void reset();
-
229};
-
230
-
231enum class TUELUserMapStatus
-
232{
-
233 map_unknown,
-
234 map_unsorted,
-
235 map_sorted,
-
236 map_sortgrow,
-
237 map_sortfull
-
238};
-
239
-
240template<typename T>
-
241using TXStrHashListImpl = gdlib::strhash::TXStrHashList<T>;
-
242
-
243template<typename T>
-
244using TXCSStrHashListImpl = gdlib::strhash::TXCSStrHashList<T>;
-
245
-
246class TUELTable : public TXStrHashListImpl<int>
-
247{
-
248 TUELUserMapStatus FMapToUserStatus { TUELUserMapStatus::map_unknown };
-
249
-
250public:
-
251 std::unique_ptr<TIntegerMapping> UsrUel2Ent {};// from user uelnr to table entry
-
252 TUELTable();
-
253 ~TUELTable() override = default;
-
254 [[nodiscard]] int size() const;
-
255 [[nodiscard]] bool empty() const;
-
256 int GetUserMap( int i );
-
257 void SetUserMap( int EN, int N );
-
258 int NewUsrUel( int EN );
-
259 int AddUsrNew( const char *s, size_t slen );
-
260 int AddUsrIndxNew( const char *s, size_t slen, int UelNr );
-
261 [[nodiscard]] int GetMaxUELLength() const;
-
262 int IndexOf( const char *s );
-
263 int AddObject( const char *id, size_t idlen, int mapping );
-
264 int StoreObject( const char *id, size_t idlen, int mapping );
-
265 const char *operator[]( int index ) const;
-
266 void RenameEntry( int N, const char *s );
-
267 [[nodiscard]] int MemoryUsed() const;
-
268 void SaveToStream( gdlib::gmsstrm::TXStreamDelphi &S );
-
269 void LoadFromStream( gdlib::gmsstrm::TXStreamDelphi &S );
-
270 TUELUserMapStatus GetMapToUserStatus();
-
271 void ResetMapToUserStatus();
-
272};
+
217public:
+
218 TIntegerMapping() = default;
+
219 ~TIntegerMapping();
+
220 [[nodiscard]] int MemoryUsed() const;
+
221 [[nodiscard]] int GetHighestIndex() const;
+
222 [[nodiscard]] int GetMapping( int F ) const;
+
223 void SetMapping( int F, int T );
+
224 [[nodiscard]] int size() const;
+
225 [[nodiscard]] bool empty() const;
+
226 void reset();
+
227};
+
228
+
229enum class TUELUserMapStatus : uint8_t
+
230{
+
231 map_unknown,
+
232 map_unsorted,
+
233 map_sorted,
+
234 map_sortgrow,
+
235 map_sortfull
+
236};
+
237
+
238template<typename T>
+
239using TXStrHashListImpl = gdlib::strhash::TXStrHashList<T>;
+
240
+
241template<typename T>
+
242using TXCSStrHashListImpl = gdlib::strhash::TXCSStrHashList<T>;
+
243
+
244class TUELTable : public TXStrHashListImpl<int>
+
245{
+
246 TUELUserMapStatus FMapToUserStatus { TUELUserMapStatus::map_unknown };
+
247
+
248public:
+
249 std::unique_ptr<TIntegerMapping> UsrUel2Ent {};// from user uelnr to table entry
+
250 TUELTable();
+
251 ~TUELTable() override = default;
+
252 [[nodiscard]] int size() const;
+
253 [[nodiscard]] bool empty() const;
+
254 int GetUserMap( int i );
+
255 void SetUserMap( int EN, int N );
+
256 int NewUsrUel( int EN );
+
257 int AddUsrNew( const char *s, size_t slen );
+
258 int AddUsrIndxNew( const char *s, size_t slen, int UelNr );
+
259 [[nodiscard]] int GetMaxUELLength() const;
+
260 int IndexOf( const char *s );
+
261 int AddObject( const char *id, size_t idlen, int mapping );
+
262 int StoreObject( const char *id, size_t idlen, int mapping );
+
263 const char *operator[]( int index ) const;
+
264 void RenameEntry( int N, const char *s );
+
265 [[nodiscard]] int MemoryUsed() const;
+
266 void SaveToStream( gdlib::gmsstrm::TXStream &S );
+
267 void LoadFromStream( gdlib::gmsstrm::TXStream &S );
+
268 TUELUserMapStatus GetMapToUserStatus();
+
269 void ResetMapToUserStatus();
+
270};
+
271
+
272int MakeGoodExplText( char *s );
273
-
274int MakeGoodExplText( char *s );
-
275
-
276struct TAcronym {
-
277 std::string AcrName, AcrText;
-
278 int AcrMap {}, AcrReadMap { -1 };
-
279 bool AcrAutoGen {};
-
280
-
281 TAcronym( const char *Name, const char *Text, int Map );
-
282 explicit TAcronym( gdlib::gmsstrm::TXStreamDelphi &S );
-
283 TAcronym() = default;
-
284 virtual ~TAcronym() = default;
-
285 [[nodiscard]] int MemoryUsed() const;
-
286 void SaveToStream( gdlib::gmsstrm::TXStreamDelphi &S ) const;
-
287 void SetNameAndText( const char *Name, const char *Text );
-
288};
-
289
-
290class TAcronymList
-
291{
-
292 gdlib::gmsobj::TXList<TAcronym> FList;
-
293
-
294public:
-
295 TAcronymList() = default;
-
296 ~TAcronymList();
-
297 int FindEntry( int Map );
-
298 int FindName( const char *Name );
-
299 int AddEntry( const char *Name, const char *Text, int Map );
-
300 void CheckEntry( int Map );
-
301 void SaveToStream( gdlib::gmsstrm::TXStreamDelphi &S );
-
302 void LoadFromStream( gdlib::gmsstrm::TXStreamDelphi &S );
-
303 int MemoryUsed();
-
304 [[nodiscard]] int size() const;
-
305 TAcronym &operator[]( int Index );
-
306};
-
307
-
308class TFilterList
-
309{
-
310 gdlib::gmsobj::TXList<TDFilter> FList;
-
311
-
312public:
-
313 TFilterList() = default;
-
314 ~TFilterList();
-
315 void AddFilter( TDFilter *F );
-
316 void DeleteFilter( int ix );
-
317 TDFilter *FindFilter( int Nr );
-
318 [[nodiscard]] size_t MemoryUsed() const;
-
319};
-
320
-
321using TIntlValueMapDbl = std::array<double, vm_count>;
-
322using TIntlValueMapI64 = std::array<int64_t, vm_count>;
-
323
-
324using LinkedDataType = gdlib::datastorage::TLinkedData<int, double>;
-
325using LinkedDataIteratorType = gdlib::datastorage::TLinkedDataRec<int, double> *;
+
274struct TAcronym {
+
275 std::string AcrName, AcrText;
+
276 int AcrMap {}, AcrReadMap { -1 };
+
277 bool AcrAutoGen {};
+
278
+
279 TAcronym( const char *Name, const char *Text, int Map );
+
280 explicit TAcronym( gdlib::gmsstrm::TXStream &S );
+
281 TAcronym() = default;
+
282 virtual ~TAcronym() = default;
+
283 [[nodiscard]] int MemoryUsed() const;
+
284 void SaveToStream( gdlib::gmsstrm::TXStream &S ) const;
+
285 void SetNameAndText( const char *Name, const char *Text );
+
286};
+
287
+
288class TAcronymList
+
289{
+
290 gdlib::gmsobj::TXList<TAcronym> FList;
+
291
+
292public:
+
293 TAcronymList() = default;
+
294 ~TAcronymList();
+
295 int FindEntry( int Map );
+
296 int FindName( const char *Name );
+
297 int AddEntry( const char *Name, const char *Text, int Map );
+
298 void CheckEntry( int Map );
+
299 void SaveToStream( gdlib::gmsstrm::TXStream &S );
+
300 void LoadFromStream( gdlib::gmsstrm::TXStream &S );
+
301 int MemoryUsed();
+
302 [[nodiscard]] int size() const;
+
303 TAcronym &operator[]( int Index );
+
304};
+
305
+
306class TFilterList
+
307{
+
308 gdlib::gmsobj::TXList<TDFilter> FList;
+
309
+
310public:
+
311 TFilterList() = default;
+
312 ~TFilterList();
+
313 void AddFilter( TDFilter *F );
+
314 void DeleteFilter( int ix );
+
315 TDFilter *FindFilter( int Nr );
+
316 [[nodiscard]] size_t MemoryUsed() const;
+
317};
+
318
+
319using TIntlValueMapDbl = std::array<double, vm_count>;
+
320using TIntlValueMapI64 = std::array<int64_t, vm_count>;
+
321
+
322using LinkedDataType = gdlib::datastorage::TLinkedData<int, double>;
+
323using LinkedDataIteratorType = gdlib::datastorage::TLinkedDataRec<int, double> *;
+
324
+
325using TSetTextList = TXCSStrHashListImpl<int>;
326
-
327using TSetTextList = TXCSStrHashListImpl<int>;
+
327using TNameList = TXStrHashListImpl<PgdxSymbRecord>;
328
-
329using TNameList = TXStrHashListImpl<PgdxSymbRecord>;
-
330
-
331template<typename T>
-
332using TTblGamsDataImpl = gdlib::gmsdata::TTblGamsData<T>;
+
329template<typename T>
+
330using TTblGamsDataImpl = gdlib::gmsdata::TTblGamsData<T>;
+
331
+
332using TDomainStrList = TXStrHashListImpl<uint8_t>;
333
-
334using TDomainStrList = TXStrHashListImpl<uint8_t>;
-
335
-
336enum tvarvaltype
-
337{
-
338 vallevel, // 1
-
339 valmarginal,// 2
-
340 vallower, // 3
-
341 valupper, // 4
-
342 valscale // 5
-
343};
+
334enum tvarvaltype : uint8_t
+
335{
+
336 vallevel, // 1
+
337 valmarginal,// 2
+
338 vallower, // 3
+
339 valupper, // 4
+
340 valscale // 5
+
341};
+
342
+
343extern std::string DLLLoadPath;// can be set by loader, so the "dll" knows where it is loaded from
344
-
345extern std::string DLLLoadPath;// can be set by loader, so the "dll" knows where it is loaded from
-
346
-
347union uInt64
-
348{
-
349 int64_t i;
-
350 void *p;
-
351};
-
352
-
353bool IsGoodIdent( const char *S );
-
354bool CanBeQuoted( const char *s, size_t slen );
-
355bool GoodUELString( const char *s, size_t slen );
+
345union uInt64
+
346{
+
347 int64_t i;
+
348 void *p;
+
349};
+
350
+
351bool IsGoodIdent( const char *S );
+
352bool CanBeQuoted( const char *s, size_t slen );
+
353bool GoodUELString( const char *s, size_t slen );
+
354
+
355int ConvertGDXFile( const std::string &fn, const std::string &MyComp );
356
-
357int ConvertGDXFile( const std::string &fn, const std::string &MyComp );
-
358
-
359}// namespace gdx
-
gdx::TAcronymList
Definition: gxfile.h:291
-
gdx::TFilterList
Definition: gxfile.h:309
-
gdx::TIntegerMapping
Definition: gxfile.h:211
-
gdx::TUELTable
Definition: gxfile.h:247
-
gdx::TgxModeSet
Definition: gxfile.h:185
-
gdx::TAcronym
Definition: gxfile.h:276
-
gdx::TDFilter
Definition: gxfile.h:81
-
gdx::TDomain
Definition: gxfile.h:119
-
gdx::TgdxSymbRecord
Definition: gxfile.h:128
-
gdx::uInt64
Definition: gxfile.h:348
+
357}// namespace gdx
+
gdx::TAcronymList
Definition: gxfile.h:289
+
gdx::TFilterList
Definition: gxfile.h:307
+
gdx::TIntegerMapping
Definition: gxfile.h:209
+
gdx::TUELTable
Definition: gxfile.h:245
+
gdx::TgxModeSet
Definition: gxfile.h:183
+
gdx::TAcronym
Definition: gxfile.h:274
+
gdx::TDFilter
Definition: gxfile.h:79
+
gdx::TDomain
Definition: gxfile.h:117
+
gdx::TgdxSymbRecord
Definition: gxfile.h:126
+
gdx::uInt64
Definition: gxfile.h:346
diff --git a/index.html b/index.html index 26715c4a..b746573a 100644 --- a/index.html +++ b/index.html @@ -411,38 +411,54 @@

Set I /.../;
Parameter A(I,*);

Assuming we have read set I already, the following code snapshot illustrates how to read parameter A.

-
// Register the filter for set I; reference this filter with integer 123
+
// We wish to only read the values of A when the first label is either "New-York" or "Chicago"
+
// For this, we assign a unique value to each one of the label, here we choose 1000 and 2000
+
// Then, we register a filter with a unique ID, here 123.
+
// Note that a filter ID cannot be reused. The filter is immutable after its creation
+
gdx.gdxUELRegisterMapStart();
+
gdx.gdxUELRegisterMap( 1000, "New-York" );
+
gdx.gdxUELRegisterMap( 2000, "Chicago" );
+
gdx.gdxUELRegisterDone();
+
// Register the filter for set I; reference this filter with integer 123 (filter number)
if(!gdx.gdxFilterRegisterStart(123))
ReportGDXError();
gdx.gdxFilterRegister(1000);
gdx.gdxFilterRegister(2000);
-
if(!gdx.gdxFilterRegisterDone()
+
if(!gdx.gdxFilterRegisterDone())
ReportGDXError();
-
// set the filter
-
Filt[0] = 123; //filter for I
-
Filt[1] = -1; // expand
+
// set the filter actions
+
std::array filterAction {
+
123, //filter for I
+
gdx::DOMC_EXPAND // expand (=-1)
+
};
// Remember highest mapped value in variable LastMapped
-
gdx.gdxUMUelInfo(NrUnMapped,LastMapped);
+
int NrUnMapped, LastMapped;
+
gdx.gdxUMUelInfo(NrUnMapped, LastMapped);
// Read parameter A as a 2 dimensional parameter
-
if(!gdx.gdxFindSymbol("A",SyNr) {
+
int SyNr;
+
if(!gdx.gdxFindSymbol("A", SyNr) {
std::cout << "**** Could not find symbol A" << std::endl;
exit(1);
}
-
gdx.gdxSymbolInfo(SyNr,SyName,SyDim,SyTyp);
+
std::array<char, GMS_SSSIZE> SyName;
+
int SyDim, SyTyp;
+
gdx.gdxSymbolInfo(SyNr, SyName.data(), SyDim, SyTyp);
if(SyDim != 2 || SyTyp != dt_par) {
std::cout << "**** A is not a two dimensional parameter" << std::endl;
exit(1);
}
-
if(!gdx.gdxReadFilteredStart(SyNr,Filt,NrRecs);
+
int NrRecs;
+
if(!gdx.gdxDataReadFilteredStart(SyNr, filterAction.data(), NrRecs));
ReportGDXError();
-
+
+
int DimFrst;
for(int N{1}; N<=NrRecs; N++) {
-
if(gdx.gdxDataReadMap(N,IndxI,Values)) {
+
if(gdx.gdxDataReadMap(N, IndxI, Values, DimFrst)) {
// do something to process the record read (index, values)
}
}
@@ -451,14 +467,17 @@

ReportGDXError();
// see if there are new unique elements
-
gdx.gdxUMUelInfo(NrUnMapped,NewLastMapped);
+
int NewLastMapped;
+
gdx.gdxUMUelInfo(NrUnMapped, NewLastMapped);
if(NewLastMapped > LastMapped) {
for(int N{LastMapped + 1}; N<=NewLastMapped; N++) {
-
gdx.gdxGetUel(N,S);
-
std::cout << "New element " << N << " = " << S << '\n';
+
std::array<char, GMS_SSSIZE> S {};
+
gdx.gdxGetUel(N,S.data());
+
std::cout << "New element " << N << " = " << S.data() << '\n';
}
}
-

+

A runnable version of this example can be found in the unit test suite under /src/tests/gdxtests.cpp as test case with the name "Test filter example from README".

+

Dealing with acronyms

In GAMS we can use acronyms in places where we can use a floating point number as in the following example:

set i /i1*i5/;
diff --git a/structgdx_1_1TAcronym-members.html b/structgdx_1_1TAcronym-members.html index 0b3110c8..ce811649 100644 --- a/structgdx_1_1TAcronym-members.html +++ b/structgdx_1_1TAcronym-members.html @@ -104,10 +104,10 @@
- + - +

Public Member Functions

GetMaxUELLength() const (defined in gdx::TUELTable)gdx::TUELTable
GetUserMap(int i) (defined in gdx::TUELTable)gdx::TUELTable
IndexOf(const char *s) (defined in gdx::TUELTable)gdx::TUELTable
LoadFromStream(gdlib::gmsstrm::TXStreamDelphi &S) (defined in gdx::TUELTable)gdx::TUELTable
LoadFromStream(gdlib::gmsstrm::TXStream &S) (defined in gdx::TUELTable)gdx::TUELTable
MemoryUsed() const (defined in gdx::TUELTable)gdx::TUELTable
NewUsrUel(int EN) (defined in gdx::TUELTable)gdx::TUELTable
operator[](int index) const (defined in gdx::TUELTable)gdx::TUELTable
RenameEntry(int N, const char *s) (defined in gdx::TUELTable)gdx::TUELTable
ResetMapToUserStatus() (defined in gdx::TUELTable)gdx::TUELTable
SaveToStream(gdlib::gmsstrm::TXStreamDelphi &S) (defined in gdx::TUELTable)gdx::TUELTable
SaveToStream(gdlib::gmsstrm::TXStream &S) (defined in gdx::TUELTable)gdx::TUELTable
SetUserMap(int EN, int N) (defined in gdx::TUELTable)gdx::TUELTable
size() const (defined in gdx::TUELTable)gdx::TUELTable
StoreObject(const char *id, size_t idlen, int mapping) (defined in gdx::TUELTable)gdx::TUELTable
int MemoryUsed () const
 
-void SaveToStream (gdlib::gmsstrm::TXStreamDelphi &S)
 
-void LoadFromStream (gdlib::gmsstrm::TXStreamDelphi &S)
 
+void SaveToStream (gdlib::gmsstrm::TXStream &S)
 
+void LoadFromStream (gdlib::gmsstrm::TXStream &S)
 
TUELUserMapStatus GetMapToUserStatus ()
 
AcrReadMap (defined in gdx::TAcronym)gdx::TAcronym
AcrText (defined in gdx::TAcronym)gdx::TAcronym
MemoryUsed() const (defined in gdx::TAcronym)gdx::TAcronym
SaveToStream(gdlib::gmsstrm::TXStreamDelphi &S) const (defined in gdx::TAcronym)gdx::TAcronym
SaveToStream(gdlib::gmsstrm::TXStream &S) const (defined in gdx::TAcronym)gdx::TAcronym
SetNameAndText(const char *Name, const char *Text) (defined in gdx::TAcronym)gdx::TAcronym
TAcronym(const char *Name, const char *Text, int Map) (defined in gdx::TAcronym)gdx::TAcronym
TAcronym(gdlib::gmsstrm::TXStreamDelphi &S) (defined in gdx::TAcronym)gdx::TAcronymexplicit
TAcronym(gdlib::gmsstrm::TXStream &S) (defined in gdx::TAcronym)gdx::TAcronymexplicit
TAcronym()=default (defined in gdx::TAcronym)gdx::TAcronym
~TAcronym()=default (defined in gdx::TAcronym)gdx::TAcronymvirtual
diff --git a/structgdx_1_1TAcronym.html b/structgdx_1_1TAcronym.html index 1ac7310e..27c4c553 100644 --- a/structgdx_1_1TAcronym.html +++ b/structgdx_1_1TAcronym.html @@ -105,15 +105,15 @@  TAcronym (const char *Name, const char *Text, int Map)   -TAcronym (gdlib::gmsstrm::TXStreamDelphi &S) -  +TAcronym (gdlib::gmsstrm::TXStream &S) +  int MemoryUsed () const   - -void SaveToStream (gdlib::gmsstrm::TXStreamDelphi &S) const -  + +void SaveToStream (gdlib::gmsstrm::TXStream &S) const +  void SetNameAndText (const char *Name, const char *Text)   diff --git a/structgdx_1_1TgdxSymbRecord.html b/structgdx_1_1TgdxSymbRecord.html index 9fc9bfad..b7f47556 100644 --- a/structgdx_1_1TgdxSymbRecord.html +++ b/structgdx_1_1TgdxSymbRecord.html @@ -131,6 +131,9 @@ bool SIsCompressed   + +bool SScalarFrst std::unique_ptr< int[]> SDomSymbols   @@ -140,9 +143,6 @@ std::optional< TCommentsList > SCommentsList   - -bool SScalarFrst std::unique_ptr< TSetBitMap > SSetBitMap