Qore Programming Language
0.8.11.1
|
use this class to make assignments to hash keys from a pointer to the key value More...
#include <QoreHashNode.h>
Public Member Functions | |
DLLLOCAL | HashAssignmentHelper (QoreHashNode &n_h, const char *key, bool must_already_exist=false) |
constructor taking a const char* More... | |
DLLLOCAL | HashAssignmentHelper (QoreHashNode &n_h, const std::string &key, bool must_already_exist=false) |
constructor taking a const std::string& More... | |
DLLLOCAL | HashAssignmentHelper (ExceptionSink *xsink, QoreHashNode &n_h, const QoreString &key, bool must_already_exist=false) |
constructor taking a const QoreString& More... | |
DLLLOCAL | HashAssignmentHelper (ExceptionSink *xsink, QoreHashNode &n_h, const QoreString *key, bool must_already_exist=false) |
constructor taking a const QoreString& More... | |
DLLLOCAL | HashAssignmentHelper (HashIterator &hi) |
constructor taking a HashIterator& More... | |
DLLLOCAL | ~HashAssignmentHelper () |
destroys the object and does post processing on the new value | |
DLLLOCAL void | assign (AbstractQoreNode *v, ExceptionSink *xsink) |
assigns a value to the hash key, dereferences any old value, assumes that the value is already referenced for the assignment More... | |
DLLLOCAL | operator bool () const |
returns true if the object is holding a valid pointer, false if not More... | |
DLLLOCAL AbstractQoreNode * | operator* () const |
returns the current value of the hash key; the pointer returned is still owned by the hash More... | |
DLLLOCAL AbstractQoreNode * | swap (AbstractQoreNode *v, ExceptionSink *xsink) |
swaps the current value with the new value of the hash key, assumes that the new value is already referenced for the assignment; returns the old value More... | |
Protected Attributes | |
class hash_assignment_priv * | priv |
private implementation | |
use this class to make assignments to hash keys from a pointer to the key value
DLLLOCAL HashAssignmentHelper::HashAssignmentHelper | ( | QoreHashNode & | n_h, |
const char * | key, | ||
bool | must_already_exist = false |
||
) |
constructor taking a const char*
n_h | the hash to use |
key | the key to assign |
must_already_exist | if true, then this constructor will only succeed if the key already exists |
DLLLOCAL HashAssignmentHelper::HashAssignmentHelper | ( | QoreHashNode & | n_h, |
const std::string & | key, | ||
bool | must_already_exist = false |
||
) |
constructor taking a const std::string&
n_h | the hash to use |
key | the key to assign |
must_already_exist | if true, then this constructor will only succeed if the key already exists |
DLLLOCAL HashAssignmentHelper::HashAssignmentHelper | ( | ExceptionSink * | xsink, |
QoreHashNode & | n_h, | ||
const QoreString & | key, | ||
bool | must_already_exist = false |
||
) |
constructor taking a const QoreString&
this constructor may raise a Qore-language exception if the key argument cannot be successfully converted to the default encoding, in which case no further functions should be called on the object
xsink | the container object for Qore-language exceptions, in case one is thrown trying to covert the key encoding to the default encoding |
n_h | the hash to use |
key | the key to assign |
must_already_exist | if true, then this constructor will only succeed if the key already exists |
DLLLOCAL HashAssignmentHelper::HashAssignmentHelper | ( | ExceptionSink * | xsink, |
QoreHashNode & | n_h, | ||
const QoreString * | key, | ||
bool | must_already_exist = false |
||
) |
constructor taking a const QoreString&
this constructor may raise a Qore-language exception if the key argument cannot be successfully converted to the default encoding, in which case no further functions should be called on the object
xsink | the container object for Qore-language exceptions, in case one is thrown trying to covert the key encoding to the default encoding |
n_h | the hash to use |
key | the key to assign |
must_already_exist | if true, then this constructor will only succeed if the key already exists |
DLLLOCAL HashAssignmentHelper::HashAssignmentHelper | ( | HashIterator & | hi | ) |
constructor taking a HashIterator&
hi | the HashIterator to use for the key and hash |
DLLLOCAL void HashAssignmentHelper::assign | ( | AbstractQoreNode * | v, |
ExceptionSink * | xsink | ||
) |
assigns a value to the hash key, dereferences any old value, assumes that the value is already referenced for the assignment
a Qore-language exception could be raised when the existing value is dereferenced (i.e. if it's an object that goes out of scope and the destructor raises an exception, for example)
DLLLOCAL HashAssignmentHelper::operator bool | ( | ) | const |
returns true if the object is holding a valid pointer, false if not
in case this function returns false
DLLLOCAL AbstractQoreNode* HashAssignmentHelper::operator* | ( | ) | const |
returns the current value of the hash key; the pointer returned is still owned by the hash
DLLLOCAL AbstractQoreNode* HashAssignmentHelper::swap | ( | AbstractQoreNode * | v, |
ExceptionSink * | xsink | ||
) |
swaps the current value with the new value of the hash key, assumes that the new value is already referenced for the assignment; returns the old value
could throw a Qore-language exception if there is a type error; in this case 0 is returned and the value passed for the assignment is dereferenced