20 #ifndef __YACSANY_HXX__
21 #define __YACSANY_HXX__
63 const char *
cStr()
const {
return _str; }
64 std::size_t
size()
const {
return _len; }
90 virtual bool operator ==(
const Any& other)
const = 0;
104 static bool IsNull(
char *data);
129 AnyPtr operator[](
int i)
const;
130 AnyPtr operator[](
const char *key)
const;
131 bool operator ==(
const Any& other)
const;
132 int getIntValue()
const;
133 bool getBoolValue()
const;
134 double getDoubleValue()
const;
135 std::string getStringValue()
const;
136 const char *getBytesValue(std::size_t& len)
const;
138 void putMyReprAtPlace(
char *data)
const;
139 static void putReprAtPlace(
char *data,
const char *src,
const TypeCode *type,
bool deepCpy);
140 static void destroyReprAtPlace(
char *data,
const TypeCode *type);
141 static AnyPtr getOrBuildFromData(
char *data,
const TypeCode *type);
142 static bool takeInChargeStorageOf(
TypeCode *type);
149 AtomAny(
const std::string& val);
172 void initCoarseMemory(
char *mem,
unsigned int size,
Deallocator dealloc);
173 void construct(
char *pt,
const Any *val);
174 void construct(
char *pt,
const char *val,
const TypeCode *tc,
bool deepCpy);
175 char *allocate(
unsigned int nbOfByte);
176 void destroy(
char *pt,
const TypeCode *tc);
177 void deallocate(
char *pt);
178 unsigned int size()
const;
179 std::vector<unsigned int> getSetItems()
const;
188 AnyPtr operator[](
const char *key)
const;
193 void checkTypeOf(
const Any *elem)
const;
195 int getIntValue()
const;
196 bool getBoolValue()
const;
197 double getDoubleValue()
const;
198 std::string getStringValue()
const;
209 unsigned int size()
const {
return _alloc.size(); }
210 void pushBack(
const Any *elem);
211 bool operator ==(
const Any& other)
const;
212 void setEltAtRank(
int i,
const Any *elem);
213 AnyPtr operator[](
int i)
const;
216 static SequenceAny *New(
const std::vector<T>& vec);
221 std::vector<unsigned int>
getSetItems()
const {
return _alloc.getSetItems(); }
224 void putMyReprAtPlace(
char *data)
const;
225 static void putReprAtPlace(
char *data,
const char *src,
const TypeCode *type,
bool deepCpy);
226 static void destroyReprAtPlace(
char *data,
const TypeCode *type);
227 static AnyPtr getOrBuildFromData(
char *data,
const TypeCode *type);
228 static bool takeInChargeStorageOf(
TypeCode *type);
241 void realloc(
char *endOfCurrentAllocated,
const Any *elem);
242 char *performCpy(
char *srcStart,
char *srcFinish,
char *destStart);
253 void setEltAtRank(
int i,
const Any *elem);
254 bool operator ==(
const Any& other)
const;
255 AnyPtr operator[](
int i)
const;
256 unsigned int size()
const;
259 static ArrayAny *New(
const std::vector<T>& vec);
261 static ArrayAny *New(
const T *val,
unsigned int lgth);
264 void putMyReprAtPlace(
char *data)
const;
265 static void putReprAtPlace(
char *data,
const char *src,
const TypeCodeArray *type,
bool deepCpy);
266 static void destroyReprAtPlace(
char *data,
const TypeCodeArray *type);
268 static bool takeInChargeStorageOf(
TypeCode *type);
274 ArrayAny(
const int *val,
unsigned int lgth);
275 ArrayAny(
const bool *val,
unsigned int lgth);
276 ArrayAny(
const double *val,
unsigned int lgth);
277 ArrayAny(
const std::vector<int>& val);
278 ArrayAny(
const std::vector<double>& val);
279 ArrayAny(
const std::vector<std::string>& val);
291 bool operator ==(
const Any& other)
const;
293 AnyPtr operator[](
int i)
const;
294 AnyPtr operator[](
const char *key)
const;
295 void setEltAtRank(
int i,
const Any *elem);
296 void setEltAtRank(
const char *key,
const Any *elem);
298 void putMyReprAtPlace(
char *data)
const;
299 static void putReprAtPlace(
char *data,
const char *src,
const TypeCodeStruct *type,
bool deepCpy);
300 static void destroyReprAtPlace(
char *data,
const TypeCodeStruct *type);
#define YACSLIBENGINE_EXPORT
: Allow to manage memory of instances of T. The only constraint on T is to have method incrRef and De...
: Interface for management of storage of data formated dynamically in its TypeCode....
virtual std::string getStringValue() const =0
virtual Any * clone() const =0
virtual int getIntValue() const =0
virtual void putMyReprAtPlace(char *data) const =0
virtual AnyPtr operator[](int i) const =0
virtual AnyPtr operator[](const char *key) const =0
virtual double getDoubleValue() const =0
virtual bool getBoolValue() const =0
const TypeCode * getType() const
static ArrayAny * New(const std::vector< T > &vec)
static AtomAny * New(T val)
virtual void setEltAtRank(int i, const Any *elem)=0
const unsigned int _sizeOf1Elm
static const char DFT_CHAR_VAR
Deallocator _notStdDeAlloc
unsigned int size() const
std::vector< unsigned int > getSetItems() const
static SequenceAny * New(const std::vector< T > &vec)
const char * cStr() const
Class for reference objects.
Class for sequence objects.
Base class for all type objects.
YACSLIBENGINE_EXPORT std::string FromBase64Safe(const std::string &bytes)
SharedPtr< AtomAny > AtomAnyPtr
SharedPtr< ArrayAny > ArrayAnyPtr
SharedPtr< StructAny > StructAnyPtr
void(* Deallocator)(void *)
SharedPtr< SequenceAny > SequenceAnyPtr
YACSLIBENGINE_EXPORT std::string ToBase64(const std::string &bytes)
YACSLIBENGINE_EXPORT std::string FromBase64(const std::string &bytes)