MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.basecode.PropertySet Class Reference

Specifies a key-value pair of properties. More...

Inheritance diagram for MyCaffe.basecode.PropertySet:

Public Member Functions

 PropertySet (Dictionary< string, string > rgProp)
 The constructor, initialized with a dictionary of properties. More...
 
 PropertySet (string strProp)
 The constructor, initialized with a string containing a set of ';' separated key-value pairs. More...
 
 PropertySet ()
 The constructor. More...
 
bool MovePropertyToBlob (string strName)
 Move the property from the list of properties to the list of blobs, storing the blob as a 0 terminated string of bytes. More...
 
void Merge (PropertySet prop)
 Merge a given property set into this one. More...
 
string GetProperty (string strName, bool bThrowExceptions=true)
 Returns a property as a string value. More...
 
int GetPropertyInt (string strName, bool bThrowExceptions=true)
 Returns an int property as a int value. More...
 
byte[] GetPropertyBlob (string strName, bool bThrowExceptions=true)
 Returns a property blob as a byte array value. More...
 
void DeleteProperty (string strName)
 Delete a property by name. More...
 
void SetProperty (string strName, string strVal)
 Sets a property in the property set to a value if it exists, otherwise it adds the new property. More...
 
void SetPropertyInt (string strName, int nVal)
 Sets an int property in the property set to a value if it exists, otherwise it adds the new property. More...
 
void SetPropertyBlob (string strName, byte[] rg)
 Sets a property in the blob set to a byte array if it exists, otherwise it adds the new blob. More...
 
DateTime GetPropertyAsDateTime (string strName)
 Returns a property as a DateTime value. More...
 
bool GetPropertyAsBool (string strName, bool bDefault=false)
 Returns a property as a boolean value. More...
 
int GetPropertyAsInt (string strName, int nDefault=0)
 Returns a property as an integer value. More...
 
double GetPropertyAsDouble (string strName, double dfDefault=0)
 Returns a property as an double value. More...
 
override string ToString ()
 Returns the string representation of the properties. More...
 
IEnumerator< KeyValuePair< string, string > > GetEnumerator ()
 Returns an enumerator of the key/value pairs. More...
 

Properties

List< string > PropertyNames [get]
 Returns the list of property names contained in the property set. More...
 
List< string > PropertyBlobNames [get]
 Returns the list of blob names contained in the property set. More...
 
List< string > PropertyIntNames [get]
 Returns the list of integer property names contained in the property set. More...
 

Detailed Description

Specifies a key-value pair of properties.

Definition at line 15 of file PropertySet.cs.

Constructor & Destructor Documentation

◆ PropertySet() [1/3]

MyCaffe.basecode.PropertySet.PropertySet ( Dictionary< string, string >  rgProp)

The constructor, initialized with a dictionary of properties.

Parameters
rgPropSpecifies the properties to initialize the property set with.

Definition at line 25 of file PropertySet.cs.

◆ PropertySet() [2/3]

MyCaffe.basecode.PropertySet.PropertySet ( string  strProp)

The constructor, initialized with a string containing a set of ';' separated key-value pairs.

Parameters
strPropSpecifies the set of key-value pairs separated by ';'. Each key-value pair is in the format: 'key'='value'.

Definition at line 34 of file PropertySet.cs.

◆ PropertySet() [3/3]

MyCaffe.basecode.PropertySet.PropertySet ( )

The constructor.

Definition at line 60 of file PropertySet.cs.

Member Function Documentation

◆ DeleteProperty()

void MyCaffe.basecode.PropertySet.DeleteProperty ( string  strName)

Delete a property by name.

Parameters
strNameSpecifies the proeprty to delete.

Definition at line 201 of file PropertySet.cs.

◆ GetEnumerator()

IEnumerator< KeyValuePair< string, string > > MyCaffe.basecode.PropertySet.GetEnumerator ( )

Returns an enumerator of the key/value pairs.

Returns
The key/value pair enumerator is returned.

Definition at line 342 of file PropertySet.cs.

◆ GetProperty()

string MyCaffe.basecode.PropertySet.GetProperty ( string  strName,
bool  bThrowExceptions = true 
)

Returns a property as a string value.

Parameters
strNameSpecifies the name of the property to retrieve.
bThrowExceptionsWhen true (the default), an exception is thrown if the property is not found, otherwise a value of null is returned when not found.
Returns
The property value is returned.

Definition at line 146 of file PropertySet.cs.

◆ GetPropertyAsBool()

bool MyCaffe.basecode.PropertySet.GetPropertyAsBool ( string  strName,
bool  bDefault = false 
)

Returns a property as a boolean value.

Parameters
strNameSpecifies the name of the property.
bDefaultSpecifies the default value returned when the property is not found.
Returns
The property value is returned.

Definition at line 267 of file PropertySet.cs.

◆ GetPropertyAsDateTime()

DateTime MyCaffe.basecode.PropertySet.GetPropertyAsDateTime ( string  strName)

Returns a property as a DateTime value.

Parameters
strNameSpecifies the name of the property.
Returns
The property value is returned.

Definition at line 250 of file PropertySet.cs.

◆ GetPropertyAsDouble()

double MyCaffe.basecode.PropertySet.GetPropertyAsDouble ( string  strName,
double  dfDefault = 0 
)

Returns a property as an double value.

Parameters
strNameSpecifies the name of the property.
dfDefaultSpecifies the default value returned when the property is not found.
Returns
The property value is returned.

Definition at line 307 of file PropertySet.cs.

◆ GetPropertyAsInt()

int MyCaffe.basecode.PropertySet.GetPropertyAsInt ( string  strName,
int  nDefault = 0 
)

Returns a property as an integer value.

Parameters
strNameSpecifies the name of the property.
nDefaultSpecifies the default value returned when the property is not found.
Returns
The property value is returned.

Definition at line 287 of file PropertySet.cs.

◆ GetPropertyBlob()

byte[] MyCaffe.basecode.PropertySet.GetPropertyBlob ( string  strName,
bool  bThrowExceptions = true 
)

Returns a property blob as a byte array value.

Parameters
strNameSpecifies the name of the property blob to retrieve.
bThrowExceptionsWhen true (the default), an exception is thrown if the property blob is not found, otherwise a value of null is returned when not found.
Returns
The property blob value is returned.

Definition at line 184 of file PropertySet.cs.

◆ GetPropertyInt()

int MyCaffe.basecode.PropertySet.GetPropertyInt ( string  strName,
bool  bThrowExceptions = true 
)

Returns an int property as a int value.

Parameters
strNameSpecifies the name of the int property.
bThrowExceptionsWhen true (the default), an exception is thrown if the property is not found, otherwise a value of null is returned when not found.
Returns
The property value is returned.

Definition at line 165 of file PropertySet.cs.

◆ Merge()

void MyCaffe.basecode.PropertySet.Merge ( PropertySet  prop)

Merge a given property set into this one.

Parameters
propSpecifies the property set to merge into this one.

Definition at line 121 of file PropertySet.cs.

◆ MovePropertyToBlob()

bool MyCaffe.basecode.PropertySet.MovePropertyToBlob ( string  strName)

Move the property from the list of properties to the list of blobs, storing the blob as a 0 terminated string of bytes.

Parameters
strNameSpecifies the name of the property to move.
Returns
If the property does not exist, false is returned, otherwise true is returned.

Definition at line 93 of file PropertySet.cs.

◆ SetProperty()

void MyCaffe.basecode.PropertySet.SetProperty ( string  strName,
string  strVal 
)

Sets a property in the property set to a value if it exists, otherwise it adds the new property.

Parameters
strNameSpecifies the property name.
strValSpecifies the new property value.

Definition at line 211 of file PropertySet.cs.

◆ SetPropertyBlob()

void MyCaffe.basecode.PropertySet.SetPropertyBlob ( string  strName,
byte[]  rg 
)

Sets a property in the blob set to a byte array if it exists, otherwise it adds the new blob.

Parameters
strNameSpecifies the name of the blob.
rgSpecifies the blob data.

Definition at line 237 of file PropertySet.cs.

◆ SetPropertyInt()

void MyCaffe.basecode.PropertySet.SetPropertyInt ( string  strName,
int  nVal 
)

Sets an int property in the property set to a value if it exists, otherwise it adds the new property.

Parameters
strNameSpecifies the property name.
nValSpecifies the new property value.

Definition at line 224 of file PropertySet.cs.

◆ ToString()

override string MyCaffe.basecode.PropertySet.ToString ( )

Returns the string representation of the properties.

Returns
The string representation of the properties is returned.

Definition at line 325 of file PropertySet.cs.

Property Documentation

◆ PropertyBlobNames

List<string> MyCaffe.basecode.PropertySet.PropertyBlobNames
get

Returns the list of blob names contained in the property set.

Definition at line 75 of file PropertySet.cs.

◆ PropertyIntNames

List<string> MyCaffe.basecode.PropertySet.PropertyIntNames
get

Returns the list of integer property names contained in the property set.

Definition at line 83 of file PropertySet.cs.

◆ PropertyNames

List<string> MyCaffe.basecode.PropertySet.PropertyNames
get

Returns the list of property names contained in the property set.

Definition at line 67 of file PropertySet.cs.


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