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

Go to the SVN repository for this file.

1 /* $Id: GBWorkspace.hpp 47479 2023-05-02 13:24:02Z ucko $
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 /// @GBWorkspace.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: GBWorkspace_.hpp
37 
38 
39 #ifndef GUI_CORE_GBWORKSPACE_HPP
40 #define GUI_CORE_GBWORKSPACE_HPP
41 
42 
43 // generated includes
46 
47 // generated classes
48 
50 
51 class CProjectService;
52 
53 BEGIN_objects_SCOPE // namespace ncbi::objects::
54 
55 class CGBProjectHandle;
56 class CProjectItem;
57 class CScope;
58 
59 ///////////////////////////////////////////////////////////////////////////////
60 /// CGBWorkspace
61 
63 {
65  friend class ncbi::CProjectService;
66 public:
68  typedef vector< CRef<CGBProjectHandle> > TProjectVector;
69 
70 public:
71  CGBWorkspace(void);
72  ~CGBWorkspace(void);
73 
74  TId GetId() { return m_Id; }
75 
76  CGBProjectHandle* GetProjectFromScope(const CScope& scope);
77  CGBProjectHandle* GetProjectFromId(CGBProjectHandle::TId id);
78 
79  bool RemoveProject(CGBProjectHandle::TId id);
80 
81 
82  /// Create a unique label for a project
83  string MakeUniqueProjectTitle(const string& label) const;
84 
85  vector<CGBProjectHandle::TId> GetUnloadedProjects() const;
86  vector<CGBProjectHandle::TId> GetLoadedProjects() const;
87 
88  /// sets new filename for the Workspace
89  /// updates path to projects so that they will be correct relative paths
90  void SetFilename(const string& filename) { m_Filename = filename; }
91  string GetFilename() const { return m_Filename; }
92 
93 private:
94  // Prohibit copy constructor and assignment operator
97 
98 protected:
100 
101  /// instance run-time Id, unique within an application session
103 
104  /// filename assigned to the workspace
105  string m_Filename;
106 };
107 
108 /////////////////// CGBWorkspace inline methods
109 /////////////////// end of CGBWorkspace inline methods
110 
111 END_objects_SCOPE // namespace ncbi::objects::
112 
114 
115 #endif // GUI_CORE_GBWORKSPACE_HPP
116 /* Original file checksum: lines: 94, chars: 2592, CRC32: cab401f0 */
User-defined methods of the data storage class.
Data storage class.
CAtomicCounter –.
Definition: ncbicntr.hpp:71
CAtomicCounter::TValue TId
A workspace is a hierarchically organized set of projects Projects represent the leaves in the tree.
CGBWorkspace.
Definition: GBWorkspace.hpp:63
CGBWorkspace_Base Tparent
Definition: GBWorkspace.hpp:64
CGBWorkspace & operator=(const CGBWorkspace &value)
static CAtomicCounter m_IdCounter
CGBWorkspace.
Definition: GBWorkspace.hpp:99
TId m_Id
instance run-time Id, unique within an application session
vector< CRef< CGBProjectHandle > > TProjectVector
Definition: GBWorkspace.hpp:68
CAtomicCounter::TValue TId
Definition: GBWorkspace.hpp:67
string GetFilename() const
Definition: GBWorkspace.hpp:91
CGBWorkspace(const CGBWorkspace &value)
string m_Filename
filename assigned to the workspace
void SetFilename(const string &filename)
sets new filename for the Workspace updates path to projects so that they will be correct relative pa...
Definition: GBWorkspace.hpp:90
CProjectService - a service providing API for operations with Workspaces and Projects.
CScope –.
Definition: scope.hpp:92
TNCBIAtomicValue TValue
Alias TValue for TNCBIAtomicValue.
Definition: ncbicntr.hpp:73
#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
static const char label[]
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Jul 19 17:12:36 2024 by modify_doxy.py rev. 669887