NCBI C++ ToolKit
mcontainer.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: mcontainer.cpp 47883 2010-11-09 13:14:51Z gouriano $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Author: Eugene Vasilchenko
27 *
28 * File Description:
29 * Base class for module sets
30 *
31 */
32 
33 #include <ncbi_pch.hpp>
34 #include "mcontainer.hpp"
35 #include "namespace.hpp"
36 
38 
40  : m_Parent(0)
41 {
42 }
43 
45 {
46 }
47 
49 {
50  _ASSERT(m_Parent == 0 && parent != 0);
51  m_Parent = parent;
52 }
53 
55 {
56  _ASSERT(m_Parent != 0);
57  return *m_Parent;
58 }
59 
61 {
62  return GetModuleContainer().GetConfig();
63 }
64 
65 const string& CModuleContainer::GetSourceFileName(void) const
66 {
67  if (m_Parent != 0) {
69  } else {
70  return kEmptyStr;
71  }
72 }
73 
75 {
77 }
78 
80 {
82 }
83 
85  const string& type) const
86 {
87  return GetModuleContainer().InternalResolve(module, type);
88 }
89 
91 {
93 }
94 
96 {
97  return m_Parent?
100 }
101 
CMemoryRegistry –.
Definition: ncbireg.hpp:584
virtual CDataType * InternalResolve(const string &moduleName, const string &typeName) const
Definition: mcontainer.cpp:84
const CModuleContainer * m_Parent
Definition: mcontainer.hpp:86
virtual string GetFileNamePrefix(void) const
Definition: mcontainer.cpp:74
virtual EFileNamePrefixSource GetFileNamePrefixSource(void) const
Definition: mcontainer.cpp:79
virtual string GetNamespaceRef(const CNamespace &ns) const
Definition: mcontainer.cpp:95
const CModuleContainer & GetModuleContainer(void) const
Definition: mcontainer.cpp:54
virtual const CNamespace & GetNamespace(void) const
Definition: mcontainer.cpp:90
virtual const string & GetSourceFileName(void) const
Definition: mcontainer.cpp:65
CModuleContainer(void)
Definition: mcontainer.cpp:39
virtual ~CModuleContainer(void)
Definition: mcontainer.cpp:44
virtual const CMemoryRegistry & GetConfig(void) const
Definition: mcontainer.cpp:60
void SetModuleContainer(const CModuleContainer *parent)
Definition: mcontainer.cpp:48
string GetNamespaceRef(const CNamespace &ns) const
Definition: namespace.cpp:97
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define kEmptyStr
Definition: ncbistr.hpp:123
EFileNamePrefixSource
Definition: mcontainer.hpp:45
Definition: type.c:6
#define _ASSERT
Modified on Tue Jun 18 13:41:25 2024 by modify_doxy.py rev. 669887