Rudiments
Public Member Functions | List of all members
scalar< valuetype > Class Template Reference

Inherits scalarcollection< valuetype >.

Public Member Functions

 scalar ()
 
 scalar (scalar< valuetype > &a)
 
 scalar (scalarcollection< valuetype > &a)
 
scalar< valuetype > & operator= (scalar< valuetype > &a)
 
scalar< valuetype > & operator= (scalarcollection< valuetype > &a)
 
 ~scalar ()
 
void setValue (valuetype v)
 
valuetype getValue ()
 
valuetype & getReference ()
 
bool clear ()
 
- Public Member Functions inherited from scalarcollection< valuetype >
virtual const char * getType ()
 
virtual uint64_t getCount ()
 
virtual ssize_t write ()
 
virtual ssize_t write (output *out)
 
virtual ssize_t writeJson ()
 
virtual ssize_t writeJson (bool indent)
 
virtual ssize_t writeJson (output *out)
 
virtual ssize_t writeJson (output *out, bool indent)
 
- Public Member Functions inherited from collection
 collection ()
 
 collection (collection &c)
 
collectionoperator= (collection &c)
 
virtual ~collection ()
 
comparatorgetComparator ()
 
void setComparator (comparator *newcomp)
 
virtual bool isReadOnly ()
 
virtual bool isBlockBased ()
 
virtual uint64_t getBlockSize ()
 
virtual bool isSequentialAccess ()
 
virtual void setManageValues (bool manage)
 
virtual bool getManageValues ()
 
virtual void setManageArrayValues (bool manage)
 
virtual bool getManageArrayValues ()
 
virtual void setManageKeys (bool manage)
 
virtual bool getManageKeys ()
 
virtual void setManageArrayKeys (bool manage)
 
virtual bool getManageArrayKeys ()
 
- Public Member Functions inherited from object
virtual ~object ()
 

Detailed Description

template<class valuetype>
class scalar< valuetype >

The scalar class allows you to store a single value.

Constructor & Destructor Documentation

◆ scalar() [1/3]

template<class valuetype >
scalar< valuetype >::scalar
inline

Creates an instance of the scalar class.

◆ scalar() [2/3]

template<class valuetype >
scalar< valuetype >::scalar ( scalar< valuetype > &  a)
inline

Creates an instance of the scalar class that is a copy of "a".

◆ scalar() [3/3]

template<class valuetype >
scalar< valuetype >::scalar ( scalarcollection< valuetype > &  a)
inline

Creates an instance of the scalar class that is a copy of "a".

◆ ~scalar()

template<class valuetype >
scalar< valuetype >::~scalar
inline

Deletes this instance of the scalar class.

Member Function Documentation

◆ clear()

template<class valuetype >
bool scalar< valuetype >::clear
inlinevirtual

Removes the value currently stored in this instance, such that getValue() will return NULL or 0.

The value is only deleted if setManageValues(true) or setManageArrayValues(true) has been called.

Always returns true.

Implements collection.

◆ getReference()

template<class valuetype >
valuetype & scalar< valuetype >::getReference
inlinevirtual

Returns a reference to the value stored in this instance.

Implements scalarcollection< valuetype >.

◆ getValue()

template<class valuetype >
valuetype scalar< valuetype >::getValue
inlinevirtual

Returns the value stored in this instance. Returns NULL or 0 if no value has been stored.

Implements scalarcollection< valuetype >.

◆ operator=() [1/2]

template<class valuetype >
scalar< valuetype > & scalar< valuetype >::operator= ( scalar< valuetype > &  a)
inline

Makes this instance of the scalar class identical to "a".

◆ operator=() [2/2]

template<class valuetype >
scalar< valuetype > & scalar< valuetype >::operator= ( scalarcollection< valuetype > &  a)
inline

Makes this instance of the scalar class identical to "a".

◆ setValue()

template<class valuetype >
void scalar< valuetype >::setValue ( valuetype  v)
inlinevirtual

Sets the value stored in this instance to "v".

Implements scalarcollection< valuetype >.