NCBI C++ ToolKit
choicestr.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef CHOICESTR_HPP
2 #define CHOICESTR_HPP
3 
4 /* $Id: choicestr.hpp 79562 2017-09-20 18:15:56Z gouriano $
5 * ===========================================================================
6 *
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's official duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 *
27 * ===========================================================================
28 *
29 * Author: Eugene Vasilchenko
30 *
31 * File Description:
32 * C++ class info: includes, used classes, C++ code etc.
33 *
34 */
35 
36 #include "typestr.hpp"
37 #include "classstr.hpp"
38 #include <corelib/ncbiutil.hpp>
39 
41 
43 {
45 public:
46  enum EMemberType {
53  };
54  struct SVariantInfo {
55  string externalName;
56  string cName;
59  bool delayed;
60  bool in_union;
61  int memberTag;
62  bool noPrefix;
63  bool attlist;
64  bool noTag;
65  bool simple;
68 
69  SVariantInfo(const string& external_name, const string& name, const AutoPtr<CTypeStrings>& type,
70  bool delayed, bool in_union,
71  int tag, bool noPrefx, bool attlst, bool noTg,
72  bool simpl, const CDataType* dataTp, const CComments& commnts);
73  };
74  typedef list<SVariantInfo> TVariants;
75 
76  CChoiceTypeStrings(const string& externalName, const string& className,
77  const string& namespaceName, const CDataType* dataType,
78  const CComments& comments);
79  ~CChoiceTypeStrings(void);
80 
81  bool HaveAssignment(void) const
82  {
83  return m_HaveAssignment;
84  }
85 
86  void AddVariant(const string& external_name,
87  const string& name,
89  bool delayed, bool in_union, int tag,
90  bool noPrefix, bool attlist,
91  bool noTag, bool simple, const CDataType* dataType,
92  const CComments& commnts);
93 
94 protected:
95  virtual void GenerateClassCode(CClassCode& code,
96  CNcbiOstream& getters,
97  const string& methodPrefix,
98  bool haveUserClass,
99  const string& classPrefix) const override;
100  bool x_IsNullType(TVariants::const_iterator i) const;
101  bool x_IsNullWithAttlist(TVariants::const_iterator i, string& name) const;
102 
103 private:
106 };
107 
109 {
111 public:
112  CChoiceRefTypeStrings(const string& className, const CNamespace& ns,
113  const string& fileName, const CComments& comments);
114 
115 };
116 
118 
119 #endif
CClassRefTypeStrings CParent
Definition: choicestr.hpp:110
CChoiceRefTypeStrings(const string &className, const CNamespace &ns, const string &fileName, const CComments &comments)
Definition: choicestr.cpp:1661
CChoiceTypeStrings(const string &externalName, const string &className, const string &namespaceName, const CDataType *dataType, const CComments &comments)
Definition: choicestr.cpp:68
virtual void GenerateClassCode(CClassCode &code, CNcbiOstream &getters, const string &methodPrefix, bool haveUserClass, const string &classPrefix) const override
Definition: choicestr.cpp:161
~CChoiceTypeStrings(void)
Definition: choicestr.cpp:78
list< SVariantInfo > TVariants
Definition: choicestr.hpp:74
TVariants m_Variants
Definition: choicestr.hpp:104
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)
Definition: choicestr.cpp:82
bool HaveAssignment(void) const
Definition: choicestr.hpp:81
bool x_IsNullType(TVariants::const_iterator i) const
Definition: choicestr.cpp:137
bool x_IsNullWithAttlist(TVariants::const_iterator i, string &name) const
Definition: choicestr.cpp:142
CClassTypeStrings CParent
Definition: choicestr.hpp:44
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
int i
const char * tag
Useful/utility classes and methods.
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)
Definition: choicestr.cpp:95
AutoPtr< CTypeStrings > type
Definition: choicestr.hpp:58
Definition: inftrees.h:24
Definition: type.c:6
Modified on Tue May 21 10:53:42 2024 by modify_doxy.py rev. 669887