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

Go to the SVN repository for this file.

1 #ifndef GUI_OBJECTS_GUI_PROJECT_WORKSPACEFOLDER_HPP
2 #define GUI_OBJECTS_GUI_PROJECT_WORKSPACEFOLDER_HPP
3 
4 /* $Id: WorkspaceFolder.hpp 47479 2023-05-02 13:24:02Z ucko $
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  */
30 
31 /// @file WorkspaceFolder.hpp
32 /// User-defined methods of the data storage class.
33 ///
34 /// This file was originally generated by application DATATOOL
35 /// using the following specifications:
36 /// 'gui_project.asn'.
37 ///
38 /// New methods or data members can be added to it if needed.
39 /// See also: WorkspaceFolder_.hpp
40 
41 
42 // generated includes
44 
45 // generated classes
46 
47 #include <corelib/ncbicntr.hpp>
48 
50 
52 
53 BEGIN_objects_SCOPE // namespace ncbi::objects::
54 
55 class CGBProjectHandle;
56 
57 /////////////////////////////////////////////////////////////////////////////
59 {
61 public:
62  /// auto-incremented project Id, unique within an application session
63  typedef size_t TId;
64 
66  {
67  public:
68  virtual bool Visit(objects::CGBProjectHandle& project) = 0;
69  virtual ~IProjectVisitor() {};
70  };
71 
72 public:
73  CWorkspaceFolder(void);
74  ~CWorkspaceFolder(void);
75 
76 public:
77  TId GetId() const { return m_Id; }
78 
81 
82  const CWorkspaceFolder* FindParentFolder(CGBProjectHandle::TId id) const;
83  CWorkspaceFolder* FindParentFolder(CGBProjectHandle::TId id);
84 
85  bool RemoveProject(CGBProjectHandle::TId id);
86 
87  CGBProjectHandle* FindProjectById(CGBProjectHandle::TId id,
88  bool recursive);
89  /// finds a project in the folder and its sub folders
90  CGBProjectHandle* FindProjectByFilename(const string& filename);
91 
92  CWorkspaceFolder* FindChildFolderById(TId id, bool recursive);
93  CWorkspaceFolder* FindChildFolderByTitle(const string& title);
94 
95  void AddProject(CGBProjectHandle& project);
96 
97  void AddChildFolder(CWorkspaceFolder& child_folder);
98  void RemoveChildFolder(TId id);
99 
100  CRef<CWorkspaceFolder> RemoveProjectFolder(CWorkspaceFolder::TId id);
101 
102  /// applies the given visitor to all projects until the visitor returns false
103  bool ForEachProject(IProjectVisitor& visitor, bool recursive);
104 
105 private:
106  // Prohibit copy constructor and assignment operator
109 
110 protected:
112 
113  /// instance run-time Id, unique within an application session
115 };
116 
117 /////////////////// CWorkspaceFolder inline methods
118 
119 // constructor
120 inline
122 {
123  m_Id = m_IdCounter.Add(1) - 1;
124 }
125 
126 /////////////////// end of CWorkspaceFolder inline methods
127 
128 END_objects_SCOPE // namespace ncbi::objects::
129 
131 
132 
133 #endif // GUI_OBJECTS_GUI_PROJECT_WORKSPACEFOLDER_HPP
134 /* Original file checksum: lines: 86, chars: 2569, CRC32: 512adbca */
User-defined methods of the data storage class.
Data storage class.
CAtomicCounter –.
Definition: ncbicntr.hpp:71
CAtomicCounter::TValue TId
virtual bool Visit(objects::CGBProjectHandle &project)=0
CWorkspaceFolder_Base –.
CWorkspaceFolder & operator=(const CWorkspaceFolder &value)
TId m_Id
instance run-time Id, unique within an application session
static CAtomicCounter m_IdCounter
CWorkspaceFolder_Base Tparent
CWorkspaceFolder(const CWorkspaceFolder &value)
size_t TId
auto-incremented project Id, unique within an application session
char value[7]
Definition: config.c:431
TValue Add(int delta) THROWS_NONE
Atomically add value (=delta), and return new counter value.
Definition: ncbicntr.hpp:278
#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
CProject * GetProject(wxTreeCtrl &treeCtrl, const CItem &item)
Definition: pt_utils.cpp:77
Modified on Thu Feb 22 17:10:54 2024 by modify_doxy.py rev. 669887