IDS peak ICV v1.6.0
Loading...
Searching...
No Matches
Archive Class Reference
Inheritance diagram for Archive:

Data Structures

class  Handle
 

Public Member Functions

 Archive ()
 Constructs an empty Archive instance.
 
void Dispose ()
 Releases all resources used by the Archive class.
 
override bool HasKey (string key)
 Checks whether a key exists in the archive.
 
override ArchiveValueKind GetValueKind (string key)
 Returns the kind of value stored under a key.
 
override IReadOnlyList< string > GetKeys ()
 Returns all keys stored in the archive.
 
override void SetBool (string key, bool value)
 Sets a boolean value.
 
override bool GetBool (string key)
 Returns the boolean value.
 
override void SetInt64 (string key, long value)
 Sets an integer value.
 
override long GetInt64 (string key)
 Returns the integer value.
 
override void SetDouble (string key, double value)
 Sets a double precision floating point value.
 
override double GetDouble (string key)
 Returns the double precision floating point value.
 
override void SetString (string key, string value)
 Sets a string value.
 
override string GetString (string key)
 Returns the string value.
 
override void SetArchive (string key, IArchive value)
 Sets a nested archive.
 
override IArchive GetArchive (string key)
 Returns the nested archive.
 
override int GetArrayCount (string key)
 Returns the number of elements in an array value.
 
override void SetBoolArray (string key, IEnumerable< bool > value)
 Sets an array of boolean values.
 
override IReadOnlyList< bool > GetBoolArray (string key)
 Returns the array of boolean values.
 
override void SetInt64Array (string key, IEnumerable< long > value)
 Sets an array of integer values.
 
override IReadOnlyList< long > GetInt64Array (string key)
 Returns the array of integer values.
 
override void SetDoubleArray (string key, IEnumerable< double > value)
 Sets an array of double precision floating point values.
 
override IReadOnlyList< double > GetDoubleArray (string key)
 Returns the array of double precision floating point values.
 
override void SetStringArray (string key, IEnumerable< string > value)
 Sets an array of string values.
 
override IReadOnlyList< string > GetStringArray (string key)
 Returns the array of string values.
 
override void SetArchiveArray (string key, IEnumerable< IArchive > value)
 Sets an array of nested archives.
 
override IReadOnlyList< IArchive > GetArchiveArray (string key)
 Returns the array of nested archives.
 
override IArchive CreateArchive ()
 Creates a new archive instance.
 

Detailed Description

A key-value store that implements the IArchive interface.

The Archive class provides a concrete implementation of a serialization archive that stores data as key-value pairs. It supports various data types including primitives (bool, long, double), strings, nested archives, and arrays of these types.

var archive = new Archive();
archive.SetInt64("A", 1);
archive.SetString("B", "Text");
archive.SetInt64Array("C", new long[] { 1, 2, 3 });
var subArchive = new Archive();
subArchive.SetDouble("a", 1.2);
subArchive.SetBool("b", true);
archive.SetArchive("D", subArchive);
Archive()
Constructs an empty Archive instance.
Definition Archive.cs:95
See also
IDSImaging.Peak.Common.Serialization.IArchive
Since
IDSImaging.Peak.ICV 1.3

Constructor & Destructor Documentation

◆ Archive()

Archive ( )
inline

Constructs an empty Archive instance.

Exceptions
IcvInvalidConfigurationExceptionThe library is not initialized.
Since
IDSImaging.Peak.ICV 1.3

Member Function Documentation

◆ CreateArchive()

override IArchive CreateArchive ( )
inline

Creates a new archive instance.

Returns
A new IArchive instance.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ Dispose()

void Dispose ( )
inline

Releases all resources used by the Archive class.

Since
IDSImaging.Peak.ICV 1.3

◆ GetArchive()

override IArchive GetArchive ( string key)
inline

Returns the nested archive.

Parameters
keyThe key of the archive to retrieve.
Returns
An object of interface IArchive stored under the specified key.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetArchiveArray()

override IReadOnlyList< IArchive > GetArchiveArray ( string key)
inline

Returns the array of nested archives.

Parameters
keyThe key of the array to retrieve.
Returns
The stored Collection of IArchive objects stored under the specified key.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetArrayCount()

override int GetArrayCount ( string key)
inline

Returns the number of elements in an array value.

Parameters
keyThe key of the array.
Returns
The number of elements in the array, or 0 if the key does not exist or is not an array.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetBool()

override bool GetBool ( string key)
inline

Returns the boolean value.

Parameters
keyThe key of the value to retrieve.
Returns
The boolean value stored under the specified key.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetBoolArray()

override IReadOnlyList< bool > GetBoolArray ( string key)
inline

Returns the array of boolean values.

Parameters
keyThe key of the array to retrieve.
Returns
The collection of boolean values stored under the specified key.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetDouble()

override double GetDouble ( string key)
inline

Returns the double precision floating point value.

Parameters
keyThe key of the value to retrieve.
Returns
The double value stored under the specified key.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetDoubleArray()

override IReadOnlyList< double > GetDoubleArray ( string key)
inline

Returns the array of double precision floating point values.

Parameters
keyThe key of the array to retrieve.
Returns
The collection of double values stored under the specified key.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetInt64()

override long GetInt64 ( string key)
inline

Returns the integer value.

Parameters
keyThe key of the value to retrieve.
Returns
The 64-bit integer value stored under the specified key.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetInt64Array()

override IReadOnlyList< long > GetInt64Array ( string key)
inline

Returns the array of integer values.

Parameters
keyThe key of the array to retrieve.
Returns
The collection of 64-bit integer values stored under the specified key.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetKeys()

override IReadOnlyList< string > GetKeys ( )
inline

Returns all keys stored in the archive.

Returns
A collection containing all stored keys.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetString()

override string GetString ( string key)
inline

Returns the string value.

Parameters
keyThe key of the value to retrieve.
Returns
The string value stored under the specified key.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetStringArray()

override IReadOnlyList< string > GetStringArray ( string key)
inline

Returns the array of string values.

Parameters
keyThe key of the array to retrieve.
Returns
The collection of string values stored under the specified key.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ GetValueKind()

override ArchiveValueKind GetValueKind ( string key)
inline

Returns the kind of value stored under a key.

Parameters
keyThe key to query.
Returns
The ArchiveValueKind representing the stored type.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ HasKey()

override bool HasKey ( string key)
inline

Checks whether a key exists in the archive.

Parameters
keyThe key to check.
Returns
true if the key exists, otherwise false.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ SetArchive()

override void SetArchive ( string key,
IArchive value )
inline

Sets a nested archive.

Parameters
keyThe key under which to store the archive.
valueA non-null IArchive instance to store under the specified key.
Exceptions
IcvMismatchExceptionThe specified value is not an instance of Archive.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ SetArchiveArray()

override void SetArchiveArray ( string key,
IEnumerable< IArchive > value )
inline

Sets an array of nested archives.

Parameters
keyThe key under which to store the array.
valueA non-null collection of IArchive instances to store.
Exceptions
IcvNullPointerExceptionThe specified value is null or contains null/invalid entries.
IcvInternalErrorExceptionThe underlying handle cannot be safely pinned.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ SetBool()

override void SetBool ( string key,
bool value )
inline

Sets a boolean value.

Parameters
keyThe key under which to store the value.
valueThe boolean value to store.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ SetBoolArray()

override void SetBoolArray ( string key,
IEnumerable< bool > value )
inline

Sets an array of boolean values.

Parameters
keyThe key under which to store the array.
valueThe collection of boolean values to store.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ SetDouble()

override void SetDouble ( string key,
double value )
inline

Sets a double precision floating point value.

Parameters
keyThe key under which to store the value.
valueThe double value to store.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ SetDoubleArray()

override void SetDoubleArray ( string key,
IEnumerable< double > value )
inline

Sets an array of double precision floating point values.

Parameters
keyThe key under which to store the array.
valueThe collection of double values to store.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ SetInt64()

override void SetInt64 ( string key,
long value )
inline

Sets an integer value.

Parameters
keyThe key under which to store the value.
valueThe 64-bit integer value to store.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ SetInt64Array()

override void SetInt64Array ( string key,
IEnumerable< long > value )
inline

Sets an array of integer values.

Parameters
keyThe key under which to store the array.
valueThe collection of 64-bit integer values to store.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ SetString()

override void SetString ( string key,
string value )
inline

Sets a string value.

Parameters
keyThe key under which to store the value.
valueThe string value to store.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.

◆ SetStringArray()

override void SetStringArray ( string key,
IEnumerable< string > value )
inline

Sets an array of string values.

Parameters
keyThe key under which to store the array.
valueThe collection of string values to store.
Since
IDSImaging.Peak.ICV 1.3

Implements IArchive.