VMware GemFire Native C++ Reference  9.1
apache::geode::client::CacheableDate Class Reference

Implement a date object based on epoch of January 1, 1970 00:00:00 GMT that can serve as a distributable key object for caching as well as being a date value. More...

Inherits apache::geode::client::CacheableKey.

Public Member Functions

 __DEPRECATED__ ("Use localtime or similar for calendar conversions.") virtual int day() const
 
 __DEPRECATED__ ("Use localtime or similar for calendar conversions.") virtual int month() const
 
 __DEPRECATED__ ("Use localtime or similar for calendar conversions.") virtual int year() const
 
virtual int32_t classId () const
 Return the classId of the instance being serialized. More...
 
virtual int8_t DSFID () const
 return the Data Serialization Fixed ID type. More...
 
virtual SerializablefromData (DataInput &input)
 deserialize this object More...
 
virtual int32_t hashcode () const
 Returns a hash code value for this object. More...
 
virtual int32_t logString (char *buffer, int32_t maxLength) const
 used to render as a string for logging. More...
 
virtual int64_t milliseconds () const
 
virtual uint32_t objectSize () const
 
virtual bool operator== (const CacheableKey &other) const
 
void preserveSB () const
 Atomically increment reference count. More...
 
int32_t refCount ()
 
void releaseSB () const
 Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero. More...
 
virtual void toData (DataOutput &output) const
 serialize this object More...
 
virtual CacheableStringPtr toString () const
 Display this object as 'string', which depends on the implementation in the subclasses. More...
 
virtual int8_t typeId () const
 return the typeId byte of the instance being serialized. More...
 
virtual ~CacheableDate ()
 Destructor. More...
 

Static Public Member Functions

template<class PRIM >
static CacheableKeyPtr create (const PRIM value)
 Factory method that creates the key type that matches the type of value. More...
 
static CacheableDatePtr create ()
 Factory method for creating an instance of CacheableDate. More...
 
static SerializablecreateDeserializable ()
 creation function for dates. More...
 
static void registerPdxSerializer (PdxSerializerPtr pdxSerializer)
 Register the PDX serializer which can handle serialization for instances of user domain classes. More...
 
static void registerPdxType (TypeFactoryMethodPdx creationFunction)
 register an Pdx instance factory method for a given type. More...
 
static void registerType (TypeFactoryMethod creationFunction)
 register an instance factory method for a given type. More...
 

Protected Member Functions

 CacheableDate (const time_t value=0)
 Constructor, used for deserialization. More...
 
 CacheableDate (const time_point &value)
 Construct from std::chrono::time_point<std::chrono::system_clock>. More...
 
 CacheableDate (const duration &value)
 Construct from std::chrono::seconds since POSIX epoch. More...
 

Detailed Description

Implement a date object based on epoch of January 1, 1970 00:00:00 GMT that can serve as a distributable key object for caching as well as being a date value.

Constructor & Destructor Documentation

virtual apache::geode::client::CacheableDate::~CacheableDate ( )
virtual

Destructor.

apache::geode::client::CacheableDate::CacheableDate ( const time_t  value = 0)
protected

Constructor, used for deserialization.

apache::geode::client::CacheableDate::CacheableDate ( const time_point &  value)
protected

Construct from std::chrono::time_point<std::chrono::system_clock>.

apache::geode::client::CacheableDate::CacheableDate ( const duration &  value)
protected

Construct from std::chrono::seconds since POSIX epoch.

Member Function Documentation

apache::geode::client::CacheableDate::__DEPRECATED__ ( "Use localtime or similar for calendar conversions."  ) const
Returns
day of the month.
Deprecated:
Use localtime or similar for calendar conversions.
apache::geode::client::CacheableDate::__DEPRECATED__ ( "Use localtime or similar for calendar conversions."  ) const
Returns
month 1(Jan) - 12(Dec) .
Deprecated:
Use localtime or similar for calendar conversions.
apache::geode::client::CacheableDate::__DEPRECATED__ ( "Use localtime or similar for calendar conversions."  ) const
Returns
year, example 1999.
Deprecated:
Use localtime or similar for calendar conversions.
virtual int32_t apache::geode::client::CacheableDate::classId ( ) const
virtual

Return the classId of the instance being serialized.

This is used by deserialization to determine what instance type to create and deserialize into.

Implements apache::geode::client::Serializable.

template<class PRIM >
static CacheableKeyPtr apache::geode::client::CacheableKey::create ( const PRIM  value)
inlinestaticinherited

Factory method that creates the key type that matches the type of value.

For customer defined derivations of CacheableKey, the method apache::geode::client::createKey may be overloaded. For pointer types (e.g. char*) the method apache::geode::client::createKeyArr may be overloaded.

static CacheableDatePtr apache::geode::client::CacheableDate::create ( )
inlinestatic

Factory method for creating an instance of CacheableDate.

static Serializable* apache::geode::client::CacheableDate::createDeserializable ( )
static

creation function for dates.

virtual int8_t apache::geode::client::Serializable::DSFID ( ) const
virtualinherited

return the Data Serialization Fixed ID type.

This is used to determine what instance type to create and deserialize into.

Note that this should not be overridden by custom implementations and is reserved only for builtin types.

Reimplemented in apache::geode::client::Struct, and apache::geode::client::CacheableUndefined.

virtual Serializable* apache::geode::client::CacheableDate::fromData ( DataInput input)
virtual

deserialize this object

Implements apache::geode::client::Serializable.

virtual int32_t apache::geode::client::CacheableDate::hashcode ( ) const
virtual

Returns a hash code value for this object.

The result is the exclusive OR of the two halves of the primitive long value returned by the milliseconds() method.

Returns
the hashcode for this object.

Implements apache::geode::client::CacheableKey.

virtual int32_t apache::geode::client::CacheableDate::logString ( char *  buffer,
int32_t  maxLength 
) const
virtual

used to render as a string for logging.

Reimplemented from apache::geode::client::CacheableKey.

virtual int64_t apache::geode::client::CacheableDate::milliseconds ( ) const
virtual
Returns
milliseconds elapsed since January 1, 1970, 00:00:00 GMT.
virtual uint32_t apache::geode::client::CacheableDate::objectSize ( ) const
inlinevirtual
Returns
the size of the object in bytes

Reimplemented from apache::geode::client::Serializable.

virtual bool apache::geode::client::CacheableDate::operator== ( const CacheableKey other) const
virtual
Returns
true if this key matches other.

Implements apache::geode::client::CacheableKey.

void apache::geode::client::SharedBase::preserveSB ( ) const
inherited

Atomically increment reference count.

int32_t apache::geode::client::SharedBase::refCount ( )
inlineinherited
Returns
the reference count
static void apache::geode::client::Serializable::registerPdxSerializer ( PdxSerializerPtr  pdxSerializer)
staticinherited

Register the PDX serializer which can handle serialization for instances of user domain classes.

See also
PdxSerializer
static void apache::geode::client::Serializable::registerPdxType ( TypeFactoryMethodPdx  creationFunction)
staticinherited

register an Pdx instance factory method for a given type.

Exceptions
IllegalStateExceptionif the typeName has already been registered, or there is an error in registering the type; check errno for more information in the latter case.
static void apache::geode::client::Serializable::registerType ( TypeFactoryMethod  creationFunction)
staticinherited

register an instance factory method for a given type.

During registration the factory will be invoked to extract the typeId to associate with this function.

Exceptions
IllegalStateExceptionif the typeId has already been registered, or there is an error in registering the type; check errno for more information in the latter case.
void apache::geode::client::SharedBase::releaseSB ( ) const
inherited

Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero.

virtual void apache::geode::client::CacheableDate::toData ( DataOutput output) const
virtual

serialize this object

Implements apache::geode::client::Serializable.

virtual CacheableStringPtr apache::geode::client::CacheableDate::toString ( ) const
virtual

Display this object as 'string', which depends on the implementation in the subclasses.

The default implementation renders the classname.

The return value may be a temporary, so the caller has to ensure that the SharedPtr count does not go down to zero by storing the result in a variable or otherwise.

Reimplemented from apache::geode::client::Serializable.

virtual int8_t apache::geode::client::CacheableDate::typeId ( ) const
virtual

return the typeId byte of the instance being serialized.

This is used by deserialization to determine what instance type to create and deserialize into.

Reimplemented from apache::geode::client::Serializable.


Pivotal GemFire C++ Cache API Documentation