& className,
70 const string& namespaceName,
73:
CParent(externalName, className, namespaceName, dataType, comments),
74m_HaveAssignment(
false)
85 booldelayed,
boolin_union,
int tag,
86 boolnoPrefix,
boolattlist,
boolnoTag,
91noPrefix,attlist,noTag,simple,dataType,
98 booldel,
boolin_un,
int tag,
99 boolnoPrefx,
boolattlst,
100 boolnoTg,
boolsimpl,
103: externalName(external_name), cName(
Identifier(name)),
104 type(
t), delayed(del), in_union(in_un), memberTag(
tag),
105noPrefix(noPrefx), attlist(attlst), noTag(noTg), simple(simpl),
106dataType(dataTp), comments(commnts)
108 switch(
type->GetKind() ) {
145 const CDataType* resolved =
i->dataType->Resolve();
146 if(resolved && resolved !=
i->dataType) {
163 const string& methodPrefix,
165 const string& classPrefix)
const 167 boolhaveObjectPointer =
false;
168 boolhavePointers =
false;
169 boolhaveSimple =
false;
170 boolhaveString =
false, haveUtf8String =
false;
171 booldelayed =
false;
172 boolhaveAttlist =
false;
173 boolhaveBuffer =
false;
177codeClassName +=
"_Base";
181 switch(
i->memberType ) {
183havePointers =
true;
184 i->type->GeneratePointerTypeCode(
code);
190haveObjectPointer =
true;
192 i->type->GeneratePointerTypeCode(
code);
196 i->type->GenerateTypeCode(
code);
200 i->type->GenerateTypeCode(
code);
203 if(
i->in_union ) {
207 i->type->GenerateTypeCode(
code);
210 if(
i->in_union ) {
213haveUtf8String =
true;
214 i->type->GenerateTypeCode(
code);
215utf8CType =
i->type->GetCType(
code.GetNamespace());
223 code.HPPIncludes().insert(
"serial/delaybuf");
225 boolhaveUnion = havePointers || haveSimple || haveBuffer ||
226((haveString || haveUtf8String) && haveObjectPointer);
227 if( (haveString || haveUtf8String) && haveUnion && !haveBuffer ) {
229havePointers =
true;
231 boolhaveUnionData =
false;
235haveUnionData =
true;
241 stringstdNamespace =
243 stringncbiNamespace =
247 code.ClassPublic() <<
248 " /// Copy constructor.\n" 249 " "<<codeClassName<<
"(const "<<codeClassName<<
"& src);\n\n" 250 " /// Assignment operator\n" 251 " "<<codeClassName<<
"& operator=(const "<<codeClassName<<
"& src);\n\n\n";
253 code.ClassPrivate() <<
254 " // copy constructor and assignment operator\n" 255 " "<<codeClassName<<
"(const "<<codeClassName<<
"& );\n" 256 " "<<codeClassName<<
"& operator=(const "<<codeClassName<<
"& );\n";
262 size_tcurrlen, maxlen = cName.size() + 2;
265maxlen =
max(maxlen,
i->cName.size());
268 code.ClassPublic() <<
269 "\n /// Choice variants.\n" 273 for(currlen = strlen(
STATE_NOT_SET)+2; currlen < maxlen; ++currlen) {
274 code.ClassPublic() <<
" ";
277<<
" ///< No variant selected\n";
279 boolneedIni =
false;
287 code.ClassPublic() <<
" = "<<currIndex;
292 code.ClassPublic() <<
",";
293}
else if( !comments.
Empty() ) {
294 code.ClassPublic() <<
" ";
296 if( !comments.
Empty() ) {
297 code.ClassPublic() <<
string(maxlen-cName.size(),
' ');
301 code.ClassPublic() <<
"\n";
307 code.ClassPublic() <<
" };\n";
309 code.ClassPublic() <<
" /// Maximum+1 value of the choice variant enumerator.\n";
310 code.ClassPublic() <<
311 " enum E_ChoiceStopper {\n" 312 " e_MaxChoice = "<< currIndex+1 <<
" ///< == " STATE_PREFIX 318 code.ClassPublic() <<
319 " /// Reset the whole object\n" 322 code.ClassPublic() <<
"virtual ";
323 code.ClassPublic() <<
"void Reset(void);\n\n";
325 code.ClassPublic() <<
329 code.ClassPublic() <<
"virtual ";
330 code.ClassPublic() <<
"void ResetSelection(void);\n\n";
333 code.ClassPublic() <<
334 " /// Which variant is currently selected.\n";
336 code.ClassPublic() <<
339 " /// Choice state enumerator.\n";
341 code.ClassPublic() <<
343 " /// Verify selection, throw exception if it differs from the expected.\n";
345 code.ClassPublic() <<
347 " /// @param index\n" 348 " /// Expected selection.\n";
350 code.ClassPublic() <<
351 " void CheckSelected(" STATE_ENUM " index) const;\n\n" 352 " /// Throw \'InvalidSelection\' exception.\n";
354 code.ClassPublic() <<
356 " /// @param index\n" 357 " /// Expected selection.\n";
359 code.ClassPublic() <<
360 " NCBI_NORETURN void ThrowInvalidSelection(" STATE_ENUM " index) const;\n\n" 361 " /// Retrieve selection name (for diagnostic purposes).\n";
363 code.ClassPublic() <<
365 " /// @param index\n" 366 " /// One of possible selection states.\n" 368 " /// Name string.\n";
370 code.ClassPublic() <<
371 " static "<<stdNamespace<<
"string SelectionName(" STATE_ENUM " index);\n" 374 " /// Select the requested variant if needed.\n";
378 " /// @param index\n" 379 " /// New selection state.\n" 380 " /// @param reset\n" 381 " /// Flag that defines the resetting of the variant data. The data will\n" 382 " /// be reset if either the current selection differs from the new one,\n" 383 " /// or the flag is set to eDoResetVariant.\n";
386 " void Select(" STATE_ENUM " index, "<<ncbiNamespace<<
"EResetVariant reset = "<<ncbiNamespace<<
"eDoResetVariant);\n";
388 " /// Select the requested variant if needed,\n" 389 " /// allocating CObject variants from memory pool.\n";
392 " "<<ncbiNamespace<<
"EResetVariant reset,\n" 393 " "<<ncbiNamespace<<
"CObjectMemoryPool* pool);\n";
396 " /// Select the requested variant using delay buffer (for internal use).\n";
400 " /// @param index\n" 401 " /// New selection state.\n";
404 " void SelectDelayBuffer(" STATE_ENUM " index);\n";
414methodPrefix<<
STATE_ENUM " "<<methodPrefix<<
"Which(void) const\n" 420 "void "<<methodPrefix<<
"CheckSelected(" STATE_ENUM " index) const\n" 423 " ThrowInvalidSelection(index);\n" 427 "void "<<methodPrefix<<
"Select(" STATE_ENUM " index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)\n" 429 " if ( reset == NCBI_NS_NCBI::eDoResetVariant || " STATE_MEMBER " != index ) {\n" 431 " ResetSelection();\n" 432 " DoSelect(index, pool);\n" 437 "void "<<methodPrefix<<
"Select(" STATE_ENUM " index, NCBI_NS_NCBI::EResetVariant reset)\n" 439 " Select(index, reset, 0);\n" 445 "void "<<methodPrefix<<
"SelectDelayBuffer(" STATE_ENUM " index)\n" 448 " NCBI_THROW(ncbi::CSerialException,eIllegalCall, \"illegal call\");\n" 457methodPrefix<<codeClassName<<
"(const "<<codeClassName<<
"& src)\n" 463methodPrefix<<codeClassName<<
"& "<<methodPrefix<<
"operator=(const "<<codeClassName<<
"& src)\n" 465 " if ( this != &src ) {\n" 475 code.ClassPrivate() <<
478 " // helper methods\n" 479 " void DoSelect(" STATE_ENUM " index, "<<ncbiNamespace<<
"CObjectMemoryPool* pool = 0);\n";
481 code.ClassPrivate() <<
482 " void DoAssign(const "<<codeClassName<<
"& src);\n";
485 code.ClassPrivate() <<
493 stringmember(
"m_");
495 string init(
"new C_");
498 code.AddInitializer(member,
init);
504 code.AddDestructionCode(
"Reset();");
509 "void "<<methodPrefix<<
"Reset(void)\n" 513methods <<
" Reset"<<
i->cName <<
"();\n";
517<<
" ResetSelection();\n";
522 "void "<<methodPrefix<<
"ResetSelection(void)\n" 524 if( haveObjectPointer || havePointers || haveString || haveUtf8String || haveBuffer ) {
542 i->type->GetDestructionCode(
"*m_"+
i->cName),
545 " delete m_"<<
i->cName<<
";\n" 552 i->type->GetDestructionCode(
"*m_"+
i->cName),
555 " m_"<<
i->cName<<
".Destruct();\n" 588 if( haveUtf8String ) {
617 if( haveObjectPointer ) {
646 "void "<<methodPrefix<<
"DoAssign(const "<<codeClassName<<
"& src)\n" 649 " switch ( index ) {\n";
651 switch(
i->memberType ) {
655 " m_"<<
i->cName<<
" = src.m_"<<
i->cName<<
";\n" 661 " m_"<<
i->cName<<
" = new T"<<
i->cName<<
"(*src.m_"<<
i->cName<<
");\n" 667 " m_"<<
i->cName<<
".Construct();\n" 668 " *m_"<<
i->cName<<
" = *src.m_"<<
i->cName<<
";\n" 712 if( haveUtf8String ) {
741 if( haveObjectPointer ) {
766 "void "<<methodPrefix<<
"DoSelect(" STATE_ENUM " index, NCBI_NS_NCBI::CObjectMemoryPool* ";
767 if( haveUnion || haveObjectPointer ) {
775methods <<
")\n{\n";
776 if( ( (haveUnion && haveUnionData) || haveObjectPointer) ) {
778 " switch ( index ) {\n";
783 switch(
i->memberType ) {
786 string init=
i->type->GetInitializer();
789 " m_"<<
i->cName<<
" = "<<
init<<
";\n" 802 " m_"<<
i->cName<<
".Construct();\n" 835 if( haveUtf8String ) {
866 code.ClassPrivate() <<
867 " static const char* const sm_SelectionNames[];\n";
870 "const char* const "<<methodPrefix<<
"sm_SelectionNames[] = {\n" 874 " \""<<
i->externalName<<
"\"";
876methods <<
" /* place holder */";
882 "NCBI_NS_STD::string "<<methodPrefix<<
"SelectionName(" STATE_ENUM " index)\n" 884 " return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));\n" 887 "void "<<methodPrefix<<
"ThrowInvalidSelection(" STATE_ENUM " index) const\n" 889 " throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO";
891methods <<
", this";
893methods <<
", m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));\n" 900 code.ClassPublic() <<
903 stringcType =
i->type->GetCType(
code.GetNamespace());
905 code.ClassPublic() <<
906 " typedef "<<cType<<
" T"<<
i->cName<<
";\n";
909 code.ClassPublic() <<
915 code.ClassPublic() <<
920 stringcType =
i->type->GetCType(
code.GetNamespace());
921 stringtType =
"T"+
i->cName;
922 stringtTypeStorage = tType;
923 stringcTypeStorage =
i->type->GetStorageType(
code.GetNamespace());
924 if(cTypeStorage != cType) {
925tTypeStorage = cTypeStorage;
928 stringrType =
i->type->GetPrefixedCType(
code.GetNamespace(),methodPrefix);
931 stringrType = methodPrefix + tType;
941<<
" // typedef "<< cType <<
" "<<tType<<
"\n";
943 code.ClassPublic() <<
"\n";
948 code.ClassPublic() <<
949 " /// Reset the attribute list.\n";
951 code.ClassPublic() <<
952 " void Reset"<<
i->cName<<
"(void);\n";
955 code.ClassPublic() <<
957 " /// Check if variant "<<
i->cName<<
" is selected.\n" 961<<
" /// "<<
i->cName<<
" type is defined as \'typedef "<< cType <<
" "<<tType<<
"\'.\n";
963 code.ClassPublic() <<
965 " /// - true, if the variant is selected.\n" 966 " /// - false, otherwise.\n";
968 code.ClassPublic() <<
969 " bool Is"<<
i->cName<<
"(void) const;\n";
971 if(kind ==
eKindEnum|| (
i->dataType &&
i->dataType->IsPrimitive())) {
973 code.ClassPublic() <<
975 " /// Get the variant data.\n" 978 " /// Copy of the variant data.\n";
980 code.ClassPublic() <<
981 " "<<tType<<
" Get"<<
i->cName<<
"(void) const;\n";
986 code.ClassPublic() <<
988 " /// Get the attribute list data.\n";
990 code.ClassPublic() <<
992 " /// Get the variant data.\n";
994 code.ClassPublic() <<
997 " /// Reference to the data.\n";
999 code.ClassPublic() <<
1000 " const "<<tType<<
"& Get"<<
i->cName<<
"(void) const;\n";
1007 " /// Select the variant.\n";
1010 " void Set"<<
i->cName<<
"(void);\n";
1016 " /// Set the attribute list data.\n" 1019 " /// Reference to the data.\n";
1023 " /// Select the variant.\n" 1026 " /// Reference to the variant data.\n";
1030 " "<<tType<<
"& Set"<<
i->cName<<
"(void);\n";
1032 if(
i->type->CanBeCopied() ) {
1037 " /// Set the attribute list data.\n" 1039 " /// @param value\n" 1040 " /// Reference to data.\n";
1043 " void Set"<<
i->cName<<
"("<<tType<<
"& value);\n";
1049 " /// Select the variant and set its data.\n" 1051 " /// @param value\n" 1052 " /// Variant data.\n";
1054 if(kind ==
eKindEnum|| (
i->dataType &&
i->dataType->IsPrimitive())) {
1056 " void Set"<<
i->cName<<
"("<<tType<<
" value);\n";
1059 " void Set"<<
i->cName<<
"(const "<<tType<<
"& value);\n";
1069 " /// Set the attribute list data.\n";
1072 " /// Select the variant and set its data.\n";
1076 " /// @param value\n" 1077 " /// Reference to the data.\n";
1080 " void Set"<<
i->cName<<
"("<<tType<<
"& value);\n";
1083 stringconstMemberRef;
1085 switch(
i->memberType ) {
1087memberRef = constMemberRef =
"m_"+
i->cName;
1088 if(tTypeStorage != tType) {
1089constMemberRef =
"reinterpret_cast<const "+ tType +
"&>(m_"+
i->cName +
")";
1090memberRef =
"reinterpret_cast<"+ tType +
"&>(m_"+
i->cName +
")";
1095memberRef = constMemberRef =
"*m_"+
i->cName;
1101memberRef =
'*'+memberRef;
1103constMemberRef = memberRef;
1109memberRef =
'*'+memberRef;
1111constMemberRef = memberRef;
1114memberRef =
"*static_cast<T"+
i->cName+
"*>(" OBJECT_MEMBER ")";
1115constMemberRef =
"*static_cast<const T"+
i->cName+
"*>(" OBJECT_MEMBER ")";
1122 code.MethodStart(inl) <<
1123 "void "<<methodPrefix<<
"Reset"<<
i->cName<<
"(void)\n" 1125 " (*m_"<<
i->cName<<
").Reset();\n" 1128 if(
i->dataType &&
i->dataType->IsPrimitive()) {
1129 code.MethodStart(inl) << rType;
1131 code.MethodStart(inl) <<
"const "<<rType<<
"&";
1133 code.Methods(inl) <<
1134 " "<<methodPrefix<<
"Get"<<
i->cName<<
"(void) const\n" 1136 code.Methods(inl) <<
1137 " return (*m_"<<
i->cName<<
");\n" 1140 code.MethodStart(inl) <<
1141rType<<
"& "<<methodPrefix<<
"Set"<<
i->cName<<
"(void)\n" 1143 code.Methods(inl) <<
1144 " return (*m_"<<
i->cName<<
");\n" 1147 code.MethodStart(inl) <<
1148 "void "<<methodPrefix<<
"Set"<<
i->cName<<
"("<<rType<<
"& value)\n" 1150 code.Methods(inl) <<
1151 " m_"<<
i->cName<<
".Reset(&value);\n" 1157 "bool "<<methodPrefix<<
"Is"<<
i->cName<<
"(void) const\n" 1162 if(kind ==
eKindEnum|| (
i->dataType &&
i->dataType->IsPrimitive())) {
1163 code.MethodStart(inl) << rType;
1164}
else if(!isNull) {
1165 code.MethodStart(inl) <<
"const "<<rType<<
"&";
1168 code.Methods(inl) <<
1169 " "<<methodPrefix<<
"Get"<<
i->cName<<
"(void) const\n" 1172 if(
i->delayed ) {
1173 code.Methods(inl) <<
1176 code.Methods(inl) <<
1177 " return "<<constMemberRef<<
";\n" 1182 code.MethodStart(inl) <<
1183 "void "<<methodPrefix<<
"Set"<<
i->cName<<
"(void)\n";
1185 code.MethodStart(inl) <<
1186rType<<
"& "<<methodPrefix<<
"Set"<<
i->cName<<
"(void)\n";
1188 code.Methods(inl) <<
1190 " Select(" STATE_PREFIX<<
i->cName<<
", NCBI_NS_NCBI::eDoNotResetVariant);\n";
1192 if(
i->delayed ) {
1193 code.Methods(inl) <<
1196 if(isNullWithAtt) {
1197 code.Methods(inl) <<
1198 " "<<rType<<
"& value = "<<memberRef<<
";\n"<<
1199 " value.Set"<<extname<<
"();\n"<<
1200 " return value;\n";
1202 code.Methods(inl) <<
1203 " return "<<memberRef<<
";\n";
1206 code.Methods(inl) <<
1209 if(
i->type->CanBeCopied() ) {
1210 boolset_inl = (kind ==
eKindEnum|| (
i->dataType &&
i->dataType->IsPrimitive()));
1212 code.MethodStart(set_inl) <<
1213 "void "<<methodPrefix<<
"Set"<<
i->cName<<
"(";
1215 code.Methods(set_inl) << rType;
1217 code.Methods(set_inl) <<
"const "<< rType <<
"&";
1219 code.Methods(set_inl) <<
" value)\n" 1221 " Select(" STATE_PREFIX<<
i->cName<<
", NCBI_NS_NCBI::eDoNotResetVariant);\n";
1222 if(
i->delayed ) {
1223 code.Methods(set_inl) <<
1226 code.Methods(set_inl) <<
1227 " "<<memberRef<<
" = value;\n" 1234 "void "<<methodPrefix<<
"Set"<<
i->cName<<
"("<<rType<<
"& value)\n" 1236 " T"<<
i->cName<<
"* ptr = &value;\n";
1237 if(
i->delayed ) {
1246 " ResetSelection();\n" 1252 if(
i->dataType) {
1253 const CDataType* resolved =
i->dataType->Resolve();
1254 if(resolved && resolved !=
i->dataType) {
1259 if(!ir->dataType || !ir->dataType->IsPrimitive()) {
1262 stringircType(ir->type->GetCType(
1263 code.GetNamespace()));
1267 " /// Select the variant and set its data.\n" 1269 " /// @param value\n" 1270 " /// Reference to variant data.\n";
1273 " void Set"<<
i->cName<<
"(const "<<
1274ircType<<
"& value);\n";
1276 "void "<<methodPrefix<<
"Set"<<
1277 i->cName<<
"(const "<<ircType<<
1281 " Set"<<
i->cName <<
1299 code.ClassPrivate() <<
1304 code.ClassPrivate() <<
1305 " "<<ncbiNamespace<<
"CRef< T"<<
i->cName<<
" > m_"<<
i->cName<<
";\n";
1309 if( haveUnion && haveUnionData) {
1310 code.ClassPrivate() <<
" union {\n";
1314 stringtType =
"T"+
i->cName;
1315 stringcTypeStorage =
i->type->GetStorageType(
code.GetNamespace());
1316 if(cTypeStorage !=
i->type->GetCType(
code.GetNamespace())) {
1317tType = cTypeStorage;
1319 code.ClassPrivate() <<
1320 " "<<tType<<
" m_"<<
i->cName<<
";\n";
1324 code.ClassPrivate() <<
1325 " T"<<
i->cName<<
" *m_"<<
i->cName<<
";\n";
1328 code.ClassPrivate() <<
1329 " NCBI_NS_NCBI::CUnionBuffer<T"<<
i->cName<<
"> m_"<<
i->cName<<
";\n";
1334 code.ClassPrivate() <<
1338 code.ClassPrivate() <<
1342 if( haveUtf8String ) {
1344 code.ClassPrivate() <<
1345 " NCBI_NS_NCBI::CUnionBuffer<"<<
1350 code.ClassPrivate() <<
1356 if( haveObjectPointer ) {
1357 code.ClassPrivate() <<
1360 if( haveBuffer && !havePointers && !haveObjectPointer ) {
1363 code.ClassPrivate() <<
1364 " void* m_dummy_pointer_for_alignment;\n";
1366 code.ClassPrivate() <<
1369 else if( haveString || haveUtf8String ) {
1371 code.ClassPrivate() <<
1374 if(haveUtf8String) {
1375 code.ClassPrivate() <<
1381 else if( haveObjectPointer ) {
1382 code.ClassPrivate() <<
1386 code.ClassPrivate() <<
1393 "// helper methods\n" 1396 if( haveUserClass )
1397methods <<
"BEGIN_NAMED_BASE_CHOICE_INFO";
1399methods <<
"BEGIN_NAMED_CHOICE_INFO";
1408 " SET_INTERNAL_NAME(\""<<
names.m_OwnerName<<
"\", ";
1409 if( !
names.m_MemberName.empty() )
1410methods <<
"\""<<
names.m_MemberName<<
"\"";
1415 if( !module_name.empty() ) {
1417 " SET_CHOICE_MODULE(\""<<module_name<<
"\");\n";
1421 if(dataType->
HasTag()) {
1423 " SET_ASN_TAGGED_TYPE_INFO("<<
"SetTag, ("<< dataType->
GetTag() <<
','<<
1428 " SET_ASN_TAGGED_TYPE_INFO("<<
"SetTagType, ("<<
1447methods <<
"->SetNsQualified(";
1451methods <<
"false";
1459 " SET_CHOICE_DELAYED();\n";
1463methods <<
" ADD_NAMED_";
1466methods <<
"NULL_";
1469 booladdNamespace =
false;
1470 booladdCType =
false;
1471 booladdEnum =
false;
1472 booladdRef =
false;
1474 switch(
i->memberType ) {
1489methods <<
"ENUM_";
1491 if( !
i->type->GetNamespace().IsEmpty() &&
1492 code.GetNamespace() !=
i->type->GetNamespace() ) {
1493 _TRACE(
"EnumNamespace: "<<
i->type->GetNamespace()<<
" from "<<
code.GetNamespace());
1495addNamespace =
true;
1498 else if(
i->type->HaveSpecialRef() ) {
1516 else if(
i->type->HaveSpecialRef() ) {
1526methods <<
"MEMBER(\"";
1528methods <<
"CHOICE_VARIANT(\"";
1530methods <<
i->externalName<<
"\"";
1534 switch(
i->memberType ) {
1537methods <<
"m_"<<
i->cName;
1550methods <<
"m_"<<
i->cName;
1555methods <<
", "<<
i->type->GetNamespace();
1557methods <<
", "<<
i->type->GetCType(
code.GetNamespace());
1559methods <<
", "<<
i->type->GetEnumName();
1561methods <<
", "<<
i->type->GetRef(
code.GetNamespace());
1564 if(
i->delayed ) {
1565methods <<
"->SetDelayBuffer(MEMBER_PTR(m_delayBuffer))";
1567 if(
i->dataType &&
i->dataType->GetDataMember() &&
i->dataType->GetDataMember()->Optional()) {
1568methods <<
"->SetOptional()";
1571 if(
i->noPrefix) {
1572methods <<
"->SetNoPrefix()";
1576methods <<
"->SetAttlist()";
1579methods <<
"->SetNotag()";
1581 if(
i->memberTag >= 0 ) {
1582methods <<
"->GetId().SetTag("<<
i->memberTag;
1583 if(
i->dataType &&
1591 if(
i->dataType) {
1596 if(!octets && uniseq) {
1601methods <<
"->SetCompressed()";
1605methods <<
"->SetNonEmpty()";
1609 if(memNsqMode != defNsqMode) {
1610methods <<
"->SetNsQualified(";
1614methods <<
"false";
1617}
else if(defNsqMode ==
eNSUnqualified&&
i->dataType->IsReference()) {
1618methods <<
"->SetNsQualified(true)";
1623 constlist<CMemberFacet>& con =
i->dataType->GetDataMember()->GetRestrictions();
1635methods <<
"->RestrictV<decltype("<<
"m_"<<
i->cName <<
")>(";
1638methods <<
"->Restrict(";
1642methods <<
"\""<< c.GetValue() <<
"\"";
1644methods << c.GetValue();
1663 const string& fileName,
1665:
CParent(className, ns, fileName, comments)
#define UTF8_STRING_MEMBER
CChoiceRefTypeStrings(const string &className, const CNamespace &ns, const string &fileName, const CComments &comments)
CChoiceTypeStrings(const string &externalName, const string &className, const string &namespaceName, const CDataType *dataType, const CComments &comments)
virtual void GenerateClassCode(CClassCode &code, CNcbiOstream &getters, const string &methodPrefix, bool haveUserClass, const string &classPrefix) const override
~CChoiceTypeStrings(void)
list< SVariantInfo > TVariants
void AddVariant(const string &external_name, const string &name, const AutoPtr< CTypeStrings > &type, bool delayed, bool in_union, int tag, bool noPrefix, bool attlist, bool noTag, bool simple, const CDataType *dataType, const CComments &commnts)
bool HaveAssignment(void) const
bool x_IsNullType(TVariants::const_iterator i) const
bool x_IsNullWithAttlist(TVariants::const_iterator i, string &name) const
static bool GetDoxygenComments(void)
const string & GetExternalName(void) const
bool x_IsNullType(TMembers::const_iterator i) const
list< SMemberInfo > TMembers
bool HaveUserClass(void) const
const string & GetClassNameDT(void) const
static string GetSourceDataSpecString(void)
const CDataMember * GetDataMember(void) const
CAsnBinaryDefs::ETagClass GetTagClass(void) const
CClassTypeStrings * GetTypeStr(void) const
static string GetTagClassString(CAsnBinaryDefs::ETagClass tclass)
CAsnBinaryDefs::ETagType GetTagType(void) const
static string GetTagTypeString(CAsnBinaryDefs::ETagType ttype)
ENsQualifiedMode IsNsQualified(void) const
CAsnBinaryDefs::TLongTag GetTag(void) const
static const CNamespace KNCBINamespace
static const CNamespace KSTDNamespace
virtual bool IsCompressed(void) const
EType GetStringType(void) const
const CTypeStrings * GetArg1Type(void) const
const CDataType * DataType(void) const
virtual string GetCType(const CNamespace &ns) const =0
static const char * GetFacetString(ESerialFacet c)
const string & GetNamespaceName(void) const
virtual const CNamespace & GetNamespace(void) const
const string & GetModuleName(void) const
bool IsNonEmpty(void) const
CDataType * GetElementType(void)
CNcbiOstream & WriteTabbed(CNcbiOstream &out, const CNcbiOstrstream &code, const char *tab)
static const struct name_t names[]
static void DLIST_NAME() init(DLIST_LIST_TYPE *list)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
ENsQualifiedMode
Defines namespace qualification of XML tags.
const TMemberIndex kEmptyChoice
Special value for marking empty choice.
size_t TMemberIndex
Type used for indexing class members and choice variants.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition of all error codes used in serial libraries (xser.lib, xcser.lib).
constexpr bool empty(list< Ts... >) noexcept
Useful/utility classes and methods.
string Identifier(const string &typeName, bool capitalize)
SVariantInfo(const string &external_name, const string &name, const AutoPtr< CTypeStrings > &type, bool delayed, bool in_union, int tag, bool noPrefx, bool attlst, bool noTg, bool simpl, const CDataType *dataTp, const CComments &commnts)
const CDataType * dataType
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4