NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Types | Private Attributes | List of all members
CClassTypeStrings Class Reference

Search Toolkit Book for CClassTypeStrings

#include "classstr.hpp"
(Private to src/serial/datatool.)

+ Inheritance diagram for CClassTypeStrings:
+ Collaboration diagram for CClassTypeStrings:

Classes

struct  SMemberInfo
 

Public Types

typedef list< SMemberInfoTMembers
 
- Public Types inherited from CTypeStrings
enum  EKind {
  eKindStd , eKindEnum , eKindString , eKindPointer ,
  eKindRef , eKindObject , eKindClass , eKindContainer ,
  eKindOther
}
 

Public Member Functions

 CClassTypeStrings (const string &externalName, const string &className, const string &namespaceName, const CDataType *dataType, const CComments &comments)
 
 ~CClassTypeStrings (void)
 
void SetClassNamespace (const CNamespace &ns)
 
const stringGetExternalName (void) const
 
const stringGetClassNameDT (void) const
 
void SetParentClass (const string &className, const CNamespace &ns, const string &fileName)
 
void AddMember (const string &external_name, const string &name, const AutoPtr< CTypeStrings > &type, const string &pointerType, bool optional, const string &defaultValue, bool delayed, int tag, bool noPrefix, bool attlist, bool noTag, bool simple, const CDataType *dataType, bool nonEmpty, const CComments &comments)
 
void AddMember (const AutoPtr< CTypeStrings > &type, int tag, bool nonEmpty, bool noPrefix)
 
virtual string GetCType (const CNamespace &ns) const override
 
virtual string GetPrefixedCType (const CNamespace &ns, const string &methodPrefix) const override
 
virtual string GetRef (const CNamespace &ns) const override
 
virtual EKind GetKind (void) const override
 
void SetObject (bool isObject)
 
bool HaveUserClass (void) const
 
void SetHaveUserClass (bool haveUserClass)
 
bool HaveTypeInfo (void) const
 
void SetHaveTypeInfo (bool haveTypeInfo)
 
virtual void GenerateTypeCode (CClassContext &ctx) const override
 
virtual string GetResetCode (const string &var) const override
 
virtual void GenerateUserHPPCode (CNcbiOstream &out) const override
 
virtual void GenerateUserCPPCode (CNcbiOstream &out) const override
 
- Public Member Functions inherited from CTypeStrings
 CTypeStrings (void)
 
 CTypeStrings (const CComments &comments)
 
 CTypeStrings (const string &namespaceName, const CDataType *dataType)
 
 CTypeStrings (const string &namespaceName, const CDataType *dataType, const CComments &comments)
 
virtual ~CTypeStrings (void)
 
const stringGetModuleName (void) const
 
string GetModuleName (SInternalNames *names) const
 
string GetDoxygenModuleName (void) const
 
void SetModuleName (const string &name)
 
void SetNamespaceName (const string &name)
 
const stringGetNamespaceName (void) const
 
virtual bool HaveSpecialRef (void) const
 
virtual const CNamespaceGetNamespace (void) const
 
virtual const stringGetEnumName (void) const
 
virtual bool CanBeKey (void) const
 
virtual bool CanBeCopied (void) const
 
virtual bool NeedSetFlag (void) const
 
virtual string NewInstance (const string &init, const string &place=kEmptyStr) const
 
virtual string GetInitializer (void) const
 
virtual string GetDestructionCode (const string &expr) const
 
virtual string GetIsSetCode (const string &var) const
 
virtual string GetDefaultCode (const string &var) const
 
virtual void GenerateCode (CClassContext &ctx) const
 
virtual void GeneratePointerTypeCode (CClassContext &ctx) const
 
void BeginClassDeclaration (CClassContext &ctx) const
 
void PrintHPPComments (CNcbiOstream &out) const
 
const CCommentsComments (void) const
 
const CDataTypeDataType (void) const
 
void SetDataType (const CDataType *type)
 
virtual void SetStorageType (const string &storage)
 
virtual string GetStorageType (const CNamespace &ns) const
 
void SetSpecialRef (const string &ref)
 

Public Attributes

TMembers m_Members
 

Protected Member Functions

virtual void GenerateClassCode (CClassCode &code, CNcbiOstream &getters, const string &methodPrefix, bool haveUserClass, const string &classPrefix) const
 
bool x_IsNullType (TMembers::const_iterator i) const
 
bool x_IsNullWithAttlist (TMembers::const_iterator i, string &name) const
 
bool x_IsAnyContentType (TMembers::const_iterator i) const
 
bool x_IsUniSeq (TMembers::const_iterator i) const
 

Private Types

typedef CTypeStrings CParent
 

Private Attributes

bool m_IsObject
 
bool m_HaveUserClass
 
bool m_HaveTypeInfo
 
string m_ExternalName
 
string m_ClassName
 
string m_ParentClassName
 
CNamespace m_ParentClassNamespace
 
string m_ParentClassFileName
 

Additional Inherited Members

- Static Public Member Functions inherited from CTypeStrings
static void AdaptForSTL (AutoPtr< CTypeStrings > &type)
 
static const char * GetFacetString (ESerialFacet c)
 

Detailed Description

Definition at line 46 of file classstr.hpp.

Member Typedef Documentation

◆ CParent

Definition at line 48 of file classstr.hpp.

◆ TMembers

Definition at line 82 of file classstr.hpp.

Constructor & Destructor Documentation

◆ CClassTypeStrings()

CClassTypeStrings::CClassTypeStrings ( const string externalName,
const string className,
const string namespaceName,
const CDataType dataType,
const CComments comments 
)

Definition at line 53 of file classstr.cpp.

◆ ~CClassTypeStrings()

CClassTypeStrings::~CClassTypeStrings ( void  )

Definition at line 64 of file classstr.cpp.

Member Function Documentation

◆ AddMember() [1/2]

void CClassTypeStrings::AddMember ( const AutoPtr< CTypeStrings > &  type,
int  tag,
bool  nonEmpty,
bool  noPrefix 
)
inline

Definition at line 114 of file classstr.hpp.

References AddMember(), NcbiEmptyString, and tag.

◆ AddMember() [2/2]

void CClassTypeStrings::AddMember ( const string external_name,
const string name,
const AutoPtr< CTypeStrings > &  type,
const string pointerType,
bool  optional,
const string defaultValue,
bool  delayed,
int  tag,
bool  noPrefix,
bool  attlist,
bool  noTag,
bool  simple,
const CDataType dataType,
bool  nonEmpty,
const CComments comments 
)

Definition at line 112 of file classstr.cpp.

References rapidjson::defaultValue, m_Members, and tag.

Referenced by AddMember().

◆ GenerateClassCode()

void CClassTypeStrings::GenerateClassCode ( CClassCode code,
CNcbiOstream getters,
const string methodPrefix,
bool  haveUserClass,
const string classPrefix 
) const
protectedvirtual

Reimplemented in CWsdlTypeStrings, CClientPseudoTypeStrings, CChoiceTypeStrings, and CChoicePtrTypeStrings.

Definition at line 319 of file classstr.cpp.

References _ASSERT, _TRACE, CDataType::ClassName(), DataTool(), DATATOOL_VERSION, CTypeStrings::DataType(), DELAY_PREFIX, CAsnBinaryDefs::eAutomatic, CAsnBinaryDefs::eContextSpecific, eExclusiveMaximum, eExclusiveMinimum, CAsnBinaryDefs::eImplicit, eInclusiveMaximum, eInclusiveMinimum, CTypeStrings::eKindContainer, CTypeStrings::eKindEnum, CTypeStrings::eKindObject, CTypeStrings::eKindRef, CTypeStrings::eKindStd, CTypeStrings::eKindString, ctll::empty(), eMultipleOf, CDataTool::eNoRestrictions, eNSQNotSet, eNSQualified, eNSUnqualified, ePattern, CStringDataType::eStringTypeUTF8, CTemplate1TypeStrings::GetArg1Type(), GetClassNameDT(), CTypeStrings::GetCType(), CPointerTypeStrings::GetDataTypeStr(), CClassCode::GetDoxygenComments(), CUniSequenceDataType::GetElementType(), GetExternalName(), CTypeStrings::GetFacetString(), CTypeStrings::GetKind(), GetKind(), CDataType::GetMemberName(), CTypeStrings::GetModuleName(), CTypeStrings::GetNamespace(), CTypeStrings::GetNamespaceName(), CNamespace::GetNamespaceRef(), CDataType::GetRestrictions(), CDataType::GetSourceDataSpecString(), CStringDataType::GetStringType(), CDataType::GetTag(), CDataType::GetTagClass(), CDataType::GetTagClassString(), CDataType::GetTagType(), CDataType::GetTagTypeString(), CDataType::GetTypeStr(), CDataType::HasTag(), HaveUserClass(), hex(), i, Identifier(), info, init(), CDataType::IsASNDataSpec(), COctetStringDataType::IsCompressed(), CDataType::IsNillable(), CDataType::IsNsQualified(), CDataTool::IsSetCodeGenerationStyle(), ITERATE, kEmptyStr, CNamespace::KNCBINamespace, m_Members, m_ParentClassName, m_ParentClassNamespace, names, NCBI_THROW, CReferenceDataType::Resolve(), SET_PREFIX, SizeIsOne(), WriteTabbed(), x_IsAnyContentType(), x_IsNullType(), x_IsNullWithAttlist(), and x_IsUniSeq().

Referenced by GenerateTypeCode().

◆ GenerateTypeCode()

void CClassTypeStrings::GenerateTypeCode ( CClassContext ctx) const
overridevirtual

◆ GenerateUserCPPCode()

void CClassTypeStrings::GenerateUserCPPCode ( CNcbiOstream out) const
overridevirtual

Reimplemented from CTypeStrings.

Definition at line 1803 of file classstr.cpp.

References GetClassNameDT(), and out().

◆ GenerateUserHPPCode()

void CClassTypeStrings::GenerateUserHPPCode ( CNcbiOstream out) const
overridevirtual

◆ GetClassNameDT()

const string& CClassTypeStrings::GetClassNameDT ( void  ) const
inline

◆ GetCType()

string CClassTypeStrings::GetCType ( const CNamespace ns) const
overridevirtual

Implements CTypeStrings.

Definition at line 201 of file classstr.cpp.

References GetClassNameDT().

Referenced by GetPrefixedCType().

◆ GetExternalName()

const string& CClassTypeStrings::GetExternalName ( void  ) const
inline

◆ GetKind()

CTypeStrings::EKind CClassTypeStrings::GetKind ( void  ) const
overridevirtual

Implements CTypeStrings.

Definition at line 68 of file classstr.cpp.

References CTypeStrings::eKindClass, CTypeStrings::eKindObject, and m_IsObject.

Referenced by GenerateClassCode(), and GenerateTypeCode().

◆ GetPrefixedCType()

string CClassTypeStrings::GetPrefixedCType ( const CNamespace ns,
const string methodPrefix 
) const
overridevirtual

Implements CTypeStrings.

Definition at line 206 of file classstr.cpp.

References GetCType(), and HaveUserClass().

◆ GetRef()

string CClassTypeStrings::GetRef ( const CNamespace ns) const
overridevirtual

Reimplemented from CTypeStrings.

Definition at line 216 of file classstr.cpp.

References GetClassNameDT().

◆ GetResetCode()

string CClassTypeStrings::GetResetCode ( const string var) const
overridevirtual

Reimplemented from CTypeStrings.

Definition at line 221 of file classstr.cpp.

◆ HaveTypeInfo()

bool CClassTypeStrings::HaveTypeInfo ( void  ) const
inline

◆ HaveUserClass()

bool CClassTypeStrings::HaveUserClass ( void  ) const
inline

◆ SetClassNamespace()

void CClassTypeStrings::SetClassNamespace ( const CNamespace ns)

◆ SetHaveTypeInfo()

void CClassTypeStrings::SetHaveTypeInfo ( bool  haveTypeInfo)
inline

Definition at line 146 of file classstr.hpp.

References m_HaveTypeInfo.

Referenced by CClientPseudoTypeStrings::CClientPseudoTypeStrings().

◆ SetHaveUserClass()

void CClassTypeStrings::SetHaveUserClass ( bool  haveUserClass)
inline

Definition at line 137 of file classstr.hpp.

References m_HaveUserClass.

Referenced by CClientPseudoTypeStrings::CClientPseudoTypeStrings().

◆ SetObject()

void CClassTypeStrings::SetObject ( bool  isObject)
inline

Definition at line 128 of file classstr.hpp.

References m_IsObject.

Referenced by CClientPseudoTypeStrings::CClientPseudoTypeStrings().

◆ SetParentClass()

void CClassTypeStrings::SetParentClass ( const string className,
const CNamespace ns,
const string fileName 
)

◆ x_IsAnyContentType()

bool CClassTypeStrings::x_IsAnyContentType ( TMembers::const_iterator  i) const
protected

Definition at line 98 of file classstr.cpp.

References CUniSequenceDataType::GetElementType(), i, and x_IsUniSeq().

Referenced by GenerateClassCode().

◆ x_IsNullType()

bool CClassTypeStrings::x_IsNullType ( TMembers::const_iterator  i) const
protected

◆ x_IsNullWithAttlist()

bool CClassTypeStrings::x_IsNullWithAttlist ( TMembers::const_iterator  i,
string name 
) const
protected

Definition at line 79 of file classstr.cpp.

References CDataType::GetTypeStr(), i, ITERATE, m_Members, and x_IsNullType().

Referenced by GenerateClassCode().

◆ x_IsUniSeq()

bool CClassTypeStrings::x_IsUniSeq ( TMembers::const_iterator  i) const
protected

Definition at line 107 of file classstr.cpp.

References i.

Referenced by GenerateClassCode(), and x_IsAnyContentType().

Member Data Documentation

◆ m_ClassName

string CClassTypeStrings::m_ClassName
private

Definition at line 173 of file classstr.hpp.

Referenced by GetClassNameDT().

◆ m_ExternalName

string CClassTypeStrings::m_ExternalName
private

Definition at line 172 of file classstr.hpp.

Referenced by GetExternalName().

◆ m_HaveTypeInfo

bool CClassTypeStrings::m_HaveTypeInfo
private

Definition at line 171 of file classstr.hpp.

Referenced by HaveTypeInfo(), and SetHaveTypeInfo().

◆ m_HaveUserClass

bool CClassTypeStrings::m_HaveUserClass
private

Definition at line 170 of file classstr.hpp.

Referenced by HaveUserClass(), and SetHaveUserClass().

◆ m_IsObject

bool CClassTypeStrings::m_IsObject
private

Definition at line 169 of file classstr.hpp.

Referenced by GetKind(), and SetObject().

◆ m_Members

TMembers CClassTypeStrings::m_Members

◆ m_ParentClassFileName

string CClassTypeStrings::m_ParentClassFileName
private

Definition at line 176 of file classstr.hpp.

Referenced by GenerateTypeCode(), and SetParentClass().

◆ m_ParentClassName

string CClassTypeStrings::m_ParentClassName
private

Definition at line 174 of file classstr.hpp.

Referenced by GenerateClassCode(), GenerateTypeCode(), and SetParentClass().

◆ m_ParentClassNamespace

CNamespace CClassTypeStrings::m_ParentClassNamespace
private

Definition at line 175 of file classstr.hpp.

Referenced by GenerateClassCode(), GenerateTypeCode(), and SetParentClass().


The documentation for this class was generated from the following files:
Modified on Sat Jul 13 13:37:15 2024 by modify_doxy.py rev. 669887