3 #ifndef GEODE_CACHEABLEDATE_H_ 4 #define GEODE_CACHEABLEDATE_H_ 23 #include "geode_globals.hpp" 27 #include "GeodeTypeIds.hpp" 54 typedef std::chrono::system_clock clock;
55 typedef std::chrono::time_point<clock> time_point;
56 typedef std::chrono::milliseconds duration;
78 virtual int32_t classId()
const;
85 virtual int8_t typeId()
const;
91 virtual bool operator==(
const CacheableKey& other)
const;
97 __DEPRECATED__(
"Use localtime or similar for calendar conversions.")
98 virtual int day()
const;
104 __DEPRECATED__(
"Use localtime or similar for calendar conversions.")
105 virtual int month()
const;
111 __DEPRECATED__(
"Use localtime or similar for calendar conversions.")
112 virtual int year()
const;
115 virtual int64_t milliseconds()
const;
123 virtual int32_t hashcode()
const;
125 operator time_t()
const {
return m_timevalue / 1000; }
126 operator time_point()
const {
127 return clock::from_time_t(0) + duration(m_timevalue);
129 operator duration()
const {
return duration(m_timevalue); }
156 virtual int32_t logString(
char* buffer, int32_t maxLength)
const;
178 inline CacheableKeyPtr createKey(
const CacheableDate::time_point& value) {
182 inline CacheablePtr createValue(
const CacheableDate::time_point& value) {
190 #endif // GEODE_CACHEABLEDATE_H_ Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
static CacheableDatePtr create()
Factory method for creating an instance of CacheableDate.
Definition: CacheableDate.hpp:134
virtual uint32_t objectSize() const
Definition: CacheableDate.hpp:88
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition: DataOutput.hpp:74
Implement a date object based on epoch of January 1, 1970 00:00:00 GMT that can serve as a distributa...
Definition: CacheableDate.hpp:45
Defines a reference counted shared pointer.
Definition: SharedPtr.hpp:52
This abstract base class is the superclass of all user objects in the cache that can be serialized...
Definition: Serializable.hpp:53
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from...
Definition: DataInput.hpp:56
Represents a cacheable key.
Definition: CacheableKey.hpp:36
This namespace contains all the Geode C++ API classes, enumerations and globals.