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

Go to the SVN repository for this file.

1 /* $Id: GBProject.hpp 28756 2013-08-23 17:44:43Z wuliangs $
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  */
27 
28 /// @GBProject.hpp
29 /// User-defined methods of the data storage class.
30 ///
31 /// This file was originally generated by application DATATOOL
32 /// using the following specifications:
33 /// 'gui_project.asn'.
34 ///
35 /// New methods or data members can be added to it if needed.
36 /// See also: GBProject_.hpp
37 
38 
39 #ifndef GUI_CORE_GBPROJECT_HPP
40 #define GUI_CORE_GBPROJECT_HPP
41 
42 
43 // generated includes
44 #include <corelib/ncbitime.hpp>
45 #include <corelib/ncbimtx.hpp>
46 
52 
53 #include <objmgr/scope.hpp>
54 
55 // generated classes
56 
58 
59 BEGIN_objects_SCOPE // namespace ncbi::objects::
60 
61 class CDate;
62 class CProjectItem;
63 
64 /////////////////////////////////////////////////////////////////////////////
66  public CGBProject_Base,
67  public IGBProject
68 {
70 public:
71  /// our RAII-based locking primitive
73 
74  CGBProject(void);
75  ~CGBProject(void);
76 
77  /// @name Locking interface
78  /// @{
79  /// Synchronization Policy this object may be accessed from multiple
80  /// threads, so synchronization is required. Please use Lock() / Unlock()
81  /// methods or CGuard class (preferred) to take ownership of the object.
82  /// Methods of this class are NOT synchronized internally.
83  /// When working with multiple objects lock the parent object first.
84  virtual void Lock();
85  virtual void Unlock();
86  /// @}
87 
88  /// @name IGBProject Implementation
89  /// @{
91 
92  virtual void AddItem(CProjectItem& item, CProjectFolder& folder);
93 
94  const CProjectFolder& GetData() const;
96 
97  bool IsSetDescr() const;
98  const CProjectDescr& GetDescr() const;
100 
101  /// retrieve the descriptor set for this project
102  bool IsSetAnnot() const;
103  const IGBProject::TAnnot& GetAnnot() const;
105 
106  /// retrieve the data loader descriptor set for this project
107  virtual bool IsSetDataLoaders() const;
108  virtual const TDataLoaders& GetDataLoaders() const;
109  virtual TDataLoaders& SetDataLoaders();
110 
111  /// retrieve the view descriptor set for this project
112  bool IsSetViews() const;
113  const IGBProject::TViews& GetViews() const;
115 
116  // protocol implementations (should be never called)
117  virtual bool IsSetViewSettings() const {_ASSERT(false); return false; }
118  virtual const TViewSettings& GetViewSettings() const { _ASSERT(false);return m_View_settings; }
119  virtual TViewSettings& SetViewSettings() { _ASSERT(false); return m_View_settings; }
120 
121  /// scope manipulators
122  virtual void SetScope(CScope* scope);
123  virtual CScope* GetScope();
124 
125  /// SetCreateDate() will add a descriptor for creation date
126  void SetCreateDate(const CDate& date);
127 
128  /// SetModifiedDate() will add a descriptor for the update date
129  void SetModifiedDate(const CDate& date);
130  /// @}
131 
132 private:
133  // Prohibit copy constructor and assignment operator
136 
137 protected:
138  CProjectFolder* x_GetContainingFolder(CProjectFolder& root, CProjectItem& item);
139 
140 private:
141  /// mutex for controlling access to the current workspace
143 
144  /// mutable project folder
145  /// this is for compliance with the IGBProject interface
147 
148  // the Scope associated with the Project
150  TViewSettings m_View_settings; ///< fake var.should never be used
151 };
152 
153 /////////////////// CGBProject inline methods
154 
155 
156 inline
158 {
159  return eVersion1;
160 }
161 
162 
163 /////////////////// end of CGBProject inline methods
164 
165 
166 END_objects_SCOPE // namespace ncbi::objects::
167 
169 
170 #endif // GUI_CORE_GBPROJECT_HPP
171 /* Original file checksum: lines: 94, chars: 2554, CRC32: f8ccd1b9 */
User-defined methods of the data storage class.
Data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Definition: Date.hpp:53
Version 1 (unversioned) project This project description is frozen as of 12/1/2005 and should not be ...
Definition: GBProject_.hpp:94
virtual TViewSettings & SetViewSettings()
Definition: GBProject.hpp:119
CMutex m_Mutex
mutex for controlling access to the current workspace
Definition: GBProject.hpp:142
CGBProject_Base Tparent
Definition: GBProject.hpp:69
virtual const TViewSettings & GetViewSettings() const
Definition: GBProject.hpp:118
CGBProject(const CGBProject &value)
CRef< CProjectFolder > m_Folders
mutable project folder this is for compliance with the IGBProject interface
Definition: GBProject.hpp:146
TViewSettings m_View_settings
fake var.should never be used
Definition: GBProject.hpp:150
EProjectVersion GetVersion() const
retrieve this project's version; this is fixed per subclass
Definition: GBProject.hpp:157
virtual bool IsSetViewSettings() const
view-specific settings.
Definition: GBProject.hpp:117
CGuard< CGBProject > TGuard
our RAII-based locking primitive
Definition: GBProject.hpp:72
CGBProject & operator=(const CGBProject &value)
CRef< CScope > m_Scope
Definition: GBProject.hpp:149
CMutex –.
Definition: ncbimtx.hpp:749
CScope –.
Definition: scope.hpp:92
IGBProject - abstract interface for a project used by CGBProjectHandle.
Definition: igbproject.hpp:57
virtual void SetModifiedDate(const CDate &date)=0
SetModifiedDate() will add a descriptor for the update date.
list< CRef< CLoaderDescriptor > > TDataLoaders
Definition: igbproject.hpp:70
virtual void AddItem(CProjectItem &item, CProjectFolder &folder)=0
Add an item to the current project.
virtual TDataLoaders & SetDataLoaders()=0
virtual bool IsSetDataLoaders() const =0
data loader info.
virtual const TDataLoaders & GetDataLoaders() const =0
virtual CProjectFolder & SetData()=0
virtual void SetCreateDate(const CDate &date)=0
SetCreateDate() will add a descriptor for creation date.
list< CRef< CViewDescriptor > > TViews
Definition: igbproject.hpp:69
virtual EProjectVersion GetVersion() const =0
retrieve this project's version; this is fixed per subclass
list< CRef< CUser_object > > TViewSettings
Definition: igbproject.hpp:71
virtual const CProjectFolder & GetData() const =0
retrieve our project's data, in the form of a project folder this may be a contrived entity,...
list< CRef< CProjectAnnot > > TAnnot
Definition: igbproject.hpp:68
char value[7]
Definition: config.c:431
#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 NCBI_GUIOBJECTS_EXPORT
Definition: gui_export.h:511
bool IsSetAnnot(void) const
arbitrary annotations Check if a value has been assigned to Annot data member.
Definition: GBProject_.hpp:843
TDescr & SetDescr(void)
Assign a value to Descr data member.
Definition: GBProject_.hpp:643
const TViews & GetViews(void) const
Get the Views member data.
Definition: GBProject_.hpp:905
bool IsSetDescr(void) const
standard descriptors Check if a value has been assigned to Descr data member.
Definition: GBProject_.hpp:622
const TDescr & GetDescr(void) const
Get the Descr member data.
Definition: GBProject_.hpp:634
const TAnnot & GetAnnot(void) const
Get the Annot member data.
Definition: GBProject_.hpp:855
bool IsSetViews(void) const
Definition: GBProject_.hpp:893
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
Definition: GBProject_.hpp:861
TViews & SetViews(void)
Assign a value to Views data member.
Definition: GBProject_.hpp:911
Multi-threading – mutexes; rw-locks; semaphore.
Defines: CTimeFormat - storage class for time format.
#define _ASSERT
CScope & GetScope()
Modified on Mon Mar 04 05:14:30 2024 by modify_doxy.py rev. 669887