GTXclient C++ API  GTXserver-17.0.3
GTXByteArray Class Reference

Class for handling an array of bytes. More...

#include <GTXByteArray.hpp>

Public Member Functions

 GTXByteArray ()
 empty constructor
 
 GTXByteArray (gtx_long count, unsigned char values[])
 constructor from a count of items and a C byte array More...
 
 ~GTXByteArray ()
 destructor
 
 GTXByteArray (const GTXByteArray &in_bytearray)
 copy contructor More...
 
GTXByteArrayoperator= (const GTXByteArray &in_bytearray)
 operator = More...
 
gtx_long GetCount (void) const
 Get the number of byte in the list. More...
 
void Resize (gtx_long count)
 
unsigned char GetValue (gtx_long rank) const
 Get the rank'th unsigned char (0 <= rank < count) More...
 
void SetValue (gtx_long rank, unsigned char value)
 Set the rank'th unsigned char (0 <= rank < count) More...
 
const unsigned char * GetValues () const
 Get the complete values array. More...
 

Detailed Description

Class for handling an array of bytes.

Examples:
write_files.cpp.

Constructor & Destructor Documentation

GTXByteArray::GTXByteArray ( gtx_long  count,
unsigned char  values[] 
)

constructor from a count of items and a C byte array

Parameters
countnumber of values
valuesarray of values to be copied
GTXByteArray::GTXByteArray ( const GTXByteArray in_bytearray)

copy contructor

Parameters
in_bytearraysource byte array

Member Function Documentation

gtx_long GTXByteArray::GetCount ( void  ) const

Get the number of byte in the list.

Returns
number of values in the array

Referenced by GTXClient::WriteSelectionVariable(), and GTXClient::WriteSelectionVariableSub().

unsigned char GTXByteArray::GetValue ( gtx_long  rank) const

Get the rank'th unsigned char (0 <= rank < count)

Parameters
rank(0 <= rank < count) of the value to retrieve
Returns
rank'th int value
const unsigned char * GTXByteArray::GetValues ( ) const

Get the complete values array.

Returns
the pointer on the array used in the internal structure
Remarks
in C# and Java, this is changed to a copy as a native byte array

Referenced by GTXClient::WriteSelectionVariable(), and GTXClient::WriteSelectionVariableSub().

GTXByteArray & GTXByteArray::operator= ( const GTXByteArray in_bytearray)

operator =

Parameters
in_bytearraysource byte array
void GTXByteArray::Resize ( gtx_long  count)
Parameters
countnumber of values
void GTXByteArray::SetValue ( gtx_long  rank,
unsigned char  value 
)

Set the rank'th unsigned char (0 <= rank < count)

Parameters
rank(0 <= rank < count) of the value to change
valuenew rank'th int value

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