79 choice->
index = index;
112 out <<
"SEQUENCE" <<
" {";
121 TMembers::const_iterator
next =
i;
177 if (member.
Notag()) {
207 if (member.
Notag()) {
217 (*att)->PrintJSONSchema(
out,
indent, req,
true);
227 [](
const string& e) {
228 return string(
"\"").append(e).append(
"\"");
245 (*m)->GetType()->SetInChoice(
this);
259 value.Warning(
"CHOICE value expected", 11);
262 for ( TMembers::const_iterator
i =
GetMembers().begin();
264 if ( (*i)->GetName() == choice->
GetName() )
265 return (*i)->GetType()->CheckValue(choice->
GetValue());
272 unique_ptr<CChoiceTypeInfo>
280 for ( TMembers::const_iterator
i =
GetMembers().begin();
285 typeInfo->AddMember(member->
GetName(),0,
293 if (member->
Notag()) {
298 typeInfo->AddVariant(member->
GetName(), 0,
303 if (member->
Notag()) {
308 typeInfo->AssignItemsTags();
317 string alias =
GetVar(
"_fullalias");
324 "cannot create type info of _fullalias " + alias);
333 code->SetFullAlias();
363 code->AddVariant((*i)->GetName(), varType);
372 bool haveUserClass = rootClass;
373 code->SetHaveUserClass(haveUserClass);
374 code->SetObject(
true);
377 string external_name = (*i)->GetName();
378 string member_name = (*i)->GetType()->DefClassMemberName();
379 if (member_name.empty()) {
380 member_name = external_name;
382 bool delayed =
GetBoolVar((*i)->GetName()+
"._delay");
383 bool in_union =
GetBoolVar((*i)->GetName()+
"._in_union",
true);
384 code->AddVariant(external_name, member_name, varType, delayed, in_union,
385 (*i)->GetType()->GetTag(),
387 (*i)->SimpleType(),(*i)->GetType(),
389 (*i)->GetType()->SetTypeStr(&(*
code));
void transform(Container &c, UnaryFunction *op)
static TMemberIndex GetIndexAnyTypeChoice(const CChoiceTypeInfo *, TConstObjectPtr choicePtr)
static void ResetIndexAnyTypeChoice(const CChoiceTypeInfo *, TObjectPtr choicePtr)
static void SetIndexAnyTypeChoice(const CChoiceTypeInfo *, TObjectPtr choicePtr, TMemberIndex index, CObjectMemoryPool *)
static TObjectPtr CreateAnyTypeChoice(TTypeInfo, CObjectMemoryPool *)
virtual bool CheckValue(const CDataValue &value) const override
void PrintJSONSchema(CNcbiOstream &out, int indent, list< string > &required, bool contents_only=false) const override
virtual CTypeInfo * CreateTypeInfo(void) override
virtual const char * GetASNKeyword(void) const override
virtual const char * XmlMemberSeparator(void) const override
virtual AutoPtr< CTypeStrings > GetFullCType(void) const override
virtual AutoPtr< CTypeStrings > GenerateCode(void) const override
virtual string GetSpecKeyword(void) const override
virtual void PrintASN(CNcbiOstream &out, int indent) const override
virtual void FixTypeTree(void) const override
virtual AutoPtr< CTypeStrings > GetRefCType(void) const override
virtual const char * GetDEFKeyword(void) const override
virtual void PrintASN(CNcbiOstream &out, int indent) const override
const TMembers & GetMembers(void) const
list< AutoPtr< CDataMember > > TMembers
virtual void FixTypeTree(void) const override
const string & GetName(void) const
CDataType * GetType(void)
void PrintJSONSchema(CNcbiOstream &out, int indent, list< string > &required, bool contents_only=false) const
void PrintASN(CNcbiOstream &out, int indent, bool last) const
string FileName(void) const
void SetParentClassTo(CClassTypeStrings &code) const
CComments & Comments(void)
const string & GlobalName(void) const
string ClassName(void) const
const string & GetNamespaceName(void) const
CDataType * ResolveGlobal(const string &name) const
const CDataType * GetParentType(void) const
virtual CTypeRef GetTypeInfo(void)
void SetTypeStr(CClassTypeStrings *TypeStr) const
bool HasExternalName(void) const
CTypeInfo * UpdateModuleName(CTypeInfo *typeInfo) const
bool GetBoolVar(const string &value, bool default_value=false) const
const CNamespace & Namespace(void) const
const string GetVar(const string &value, int collect=0) const
static bool IsASNDataSpec(void)
virtual AutoPtr< CTypeStrings > GetRefCType(void) const
const string & GetMemberName(void) const
const string & GetName(void) const
const CDataValue & GetValue(void) const
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
void SetDataType(const CDataType *type)
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
std::ofstream out("events_result.xml")
main entry point for tests
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
element_type * release(void)
Release will release ownership of pointer to caller.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
CMemberInfo * SetNoPrefix(void)
CMemberInfo * SetAttlist(void)
CVariantInfo * SetNotag(void)
CVariantInfo * SetNoPrefix(void)
CMemberInfo * SetNotag(void)
const TMemberIndex kEmptyChoice
Special value for marking empty choice.
size_t TMemberIndex
Type used for indexing class members and choice variants.
const void * TConstObjectPtr
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
double value_type
The numeric datatype used by the parser.
CNcbiOstream & PrintASNNewLine(CNcbiOstream &out, int indent)