28 using namespace YACS::ENGINE;
95 for(std::size_t
i=0;
i<
sizeof(
void *) && isNull;
i++)
149 void **tmp=(
void **)data;
168 return new AtomAny(val,dealloc);
178 throw Exception(
"AtomAny::operator[] : try to get a part of a partitionned data whereas atomical.");
203 throw Exception(
"Value is not an int");
211 throw Exception(
"Value is not a bool");
219 throw Exception(
"Value is not a double");
227 throw Exception(
"Value is not a string");
267 void **tmp1=(
void **)src;
290 void **tmp=(
void **)data;
327 throw Exception(
"AtomAny::operator[] : try to get a part of a partitionned data not localizable by a string.");
332 if(!elem->getType()->isA(_type->contentType()))
333 throw Exception(
"ComposedAny::checkTypeOf : invalid type.");
357 _start(0),_finish(0),_endOfStorage(0)
365 _start(0),_finish(0),_endOfStorage(0)
398 memcpy(
_start,mem,sizeInByte);
428 return (
char *)::operator
new(nbOfByte);
439 ::operator
delete(pt);
460 std::vector<unsigned int>
ret;
461 unsigned int sz(
size());
462 for(
unsigned int i=0;
i<sz;
i++)
465 for(
unsigned j=0;j<_sizeOf1Elm && *pt==
DFT_CHAR_VAR;j++,pt++);
466 if(pt!=
_start+(
i+1)*_sizeOf1Elm)
506 if(!((*(*
this)[
i])==(*otherC[
i])))
514 _alloc.destroy(_alloc._start+
i*_alloc._sizeOf1Elm,_type->contentType());
515 _alloc.construct(_alloc._start+
i*_alloc._sizeOf1Elm,elem);
520 return _type->contentType()->getOrBuildAnyFromZippedData(_alloc._start+
i*_alloc._sizeOf1Elm);
529 const void *tmp=(
const void *)
this;
531 const void **tmp2=(
const void **) data;
538 void **tmp2=(
void **) src;
554 void **tmp=(
void **) data;
562 void **tmp=(
void **) data;
575 std::size_t sz(its.size());
577 for(std::size_t
i=0;
i<sz;
i++)
580 ret->setEltAtRank(i,obj);
630 _alloc(typeOfContent->getSizeInByteOfAnyReprInSeq())
635 _alloc(typeOfContent->getSizeInByteOfAnyReprInSeq())
641 _alloc(
Runtime::_tc_int->getSizeInByteOfAnyReprInSeq())
647 _alloc(
Runtime::_tc_bool->getSizeInByteOfAnyReprInSeq())
653 _alloc(
Runtime::_tc_double->getSizeInByteOfAnyReprInSeq())
659 _alloc(
Runtime::_tc_int->getSizeInByteOfAnyReprInSeq())
665 _alloc(
Runtime::_tc_bool->getSizeInByteOfAnyReprInSeq())
667 for(vector<bool>::const_iterator iter=val.begin();iter!=val.end();iter++)
675 _alloc(
Runtime::_tc_double->getSizeInByteOfAnyReprInSeq())
681 _alloc(
Runtime::_tc_string->getSizeInByteOfAnyReprInSeq())
683 for(vector<string>::const_iterator iter=val.begin();iter!=val.end();iter++)
723 for(
unsigned i=0;
i<
size;
i++,tmp+=sizePerContent)
795 for(vector<std::string>::const_iterator iter=val.begin();iter!=val.end();iter++,i++)
798 memcpy(
_data+i*sizePerContent,&st,sizePerContent);
816 if(!((*(*
this)[
i])==(*otherC[
i])))
826 throw Exception(
"Trying to access to an invalid index in an Any Tuple");
827 return _type->contentType()->getOrBuildAnyFromZippedData(_data+
i*sizePerContent);
842 return new ArrayAny(typeOfContent,lgth);
858 subType->
putReprAtPlace(data+
i*sizePerContent,src+
i*sizePerContent,deepCpy);
892 vector< pair<string,TypeCode*> >::const_iterator iter;
894 if(!((*(*
this)[(*iter).first.c_str()]==(*other[(*iter).first.c_str()]))))
901 const char what[]=
"StructAny::operator[](int i) : Struct key are strings not integers.";
908 char *whereToGet=_data;
909 vector< pair<string,TypeCode*> >::const_iterator iter;
911 if((*iter).first!=key)
917 string what(
"Unexisting key \""); what+=key; what+=
"\" for struct extraction.";
920 return (*iter).second->getOrBuildAnyFromZippedData(whereToGet);
925 const char what[]=
"Struct key are strings not integers.";
935 throw Exception(
"StructAny::setEltAtRank : invalid key given.");
936 if(!elem->getType()->isA(tcOnKey))
937 throw Exception(
"StructAny::setEltAtRank : invalid data type on the specified given key.");
939 elem->putMyReprAtPlace(_data+offset);
946 vector< pair<string,TypeCode*> >::const_iterator iter;
950 offset+=(*iter).second->getSizeInByteOfAnyReprInSeq();
957 vector< pair<string,TypeCode*> >::const_iterator iter;
960 (*iter).second->putReprAtPlace(data+offset,src+offset,deepCpy);
961 offset+=(*iter).second->getSizeInByteOfAnyReprInSeq();
967 char *whereToGet=data;
968 vector< pair<string,TypeCode*> >::const_iterator iter;
971 (*iter).second->destroyZippedAny(whereToGet);
972 whereToGet+=(*iter).second->getSizeInByteOfAnyReprInSeq();
986 vector< pair<string,TypeCode*> >::const_iterator iter;
987 char *whereToGet=
_data;
990 (*iter).second->destroyZippedAny(whereToGet);
991 whereToGet+=(*iter).second->getSizeInByteOfAnyReprInSeq();
1007 vector< pair<string,TypeCode*> >::const_iterator iter;
1012 offset+=(*iter).second->getSizeInByteOfAnyReprInSeq();
1019 vector< pair<string,TypeCode*> >::const_iterator iter;
1023 (*iter).second->putReprAtPlace(
_data+offset,data+offset,
false);
1024 offset+=(*iter).second->getSizeInByteOfAnyReprInSeq();