OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DatabaseRevisions.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSGDB_DATABASEREVISIONS
15 #define OSGDB_DATABASEREVISIONS 1
16 
17 #include <osg/Node>
18 
19 #include <osgDB/ReaderWriter>
20 
21 #include <set>
22 
23 namespace osgDB {
24 
26 {
27  public:
28 
29  FileList();
30  FileList(const FileList& fileList, const osg::CopyOp & copyop=osg::CopyOp::SHALLOW_COPY);
31 
33 
34  typedef std::set<std::string> FileNames;
35  FileNames& getFileNames() { return _files; }
36  const FileNames& getFileNames() const { return _files; }
37 
38  bool empty() const { return _files.empty(); }
39 
40  bool containsFile(const std::string& filename) const { return _files.count(filename)!=0; }
41 
42  void addFile(const std::string& filename) { _files.insert(filename); }
43 
44  bool removeFile(const std::string& filename);
45 
46  void append(FileList* fileList);
47 
48  protected:
49 
50  virtual ~FileList();
51 
52  FileNames _files;
53 };
54 
55 
57 {
58  public:
59 
62 
64 
65  void setDatabasePath(const std::string& path) { _databasePath = path; }
66  const std::string& getDatabasePath() const { return _databasePath; }
67 
68  typedef std::set<std::string> FileNames;
69 
70  void setFilesAdded(FileList* fileList) { _filesAdded = fileList; }
71  FileList* getFilesAdded() { return _filesAdded.get(); }
72  const FileList* getFilesAdded() const { return _filesAdded.get(); }
73 
74  void setFilesRemoved(FileList* fileList) { _filesRemoved = fileList; }
75  FileList* getFilesRemoved() { return _filesRemoved.get(); }
76  const FileList* getFilesRemoved() const { return _filesRemoved.get(); }
77 
78  void setFilesModified(FileList* fileList) { _filesModified = fileList; }
79  FileList* getFilesModified() { return _filesModified.get(); }
80  const FileList* getFilesModified() const { return _filesModified.get(); }
81 
82  bool isFileBlackListed(const std::string& filename) const;
83 
84  bool removeFile(const std::string& filename);
85 
86  protected:
87 
88  virtual ~DatabaseRevision();
89 
90  std::string _databasePath;
91 
95 };
96 
98 {
99  public:
100 
103 
105 
106  typedef std::vector< osg::ref_ptr<DatabaseRevision> > DatabaseRevisionList;
107 
108  void setDatabasePath(const std::string& path) { _databasePath = path; }
109  const std::string& getDatabasePath() const { return _databasePath; }
110 
111  void addRevision(DatabaseRevision* revision);
112  void removeRevision(DatabaseRevision* revision);
113 
114  DatabaseRevision* getDatabaseRevision(unsigned int i) { return i<_revisionList.size() ? _revisionList[i].get() : 0; }
115 
116  DatabaseRevisionList& getDatabaseRevisionList() { return _revisionList; }
117  const DatabaseRevisionList& getDatabaseRevisionList() const { return _revisionList; }
118 
119  bool isFileBlackListed(const std::string& filename) const;
120 
121  bool removeFile(const std::string& filename);
122 
123  protected:
124 
125  virtual ~DatabaseRevisions();
126 
127  std::string _databasePath;
128  DatabaseRevisionList _revisionList;
129 };
130 
131 }
132 
133 #endif
DatabaseRevisionList _revisionList
osg::ref_ptr< FileList > _filesAdded
const FileList * getFilesRemoved() const
META_Object(osgDB, DatabaseRevision) void setDatabasePath(const std
const FileList * getFilesModified() const
const FileNames & getFileNames() const
const std::string & getDatabasePath() const
bool containsFile(const std::string &filename) const
#define META_Object(library, name)
Definition: Object.h:42
typedef void(GL_APIENTRY *GLTexImage3DProc)(GLenum target
void setFilesAdded(FileList *fileList)
void addFile(const std::string &filename)
DatabaseRevision * getDatabaseRevision(unsigned int i)
osg::ref_ptr< FileList > _filesRemoved
META_Object(osgDB, DatabaseRevisions) typedef std void setDatabasePath(const std::string &path)
Definition: Archive.h:24
META_Object(osgDB, FileList) typedef std FileNames & getFileNames()
#define OSGDB_EXPORT
Definition: Export.h:39
DatabaseRevisionList & getDatabaseRevisionList()
osg::ref_ptr< FileList > _filesModified
void setFilesRemoved(FileList *fileList)
const DatabaseRevisionList & getDatabaseRevisionList() const
const std::string & getDatabasePath() const
const FileList * getFilesAdded() const
bool empty() const
std::set< std::string > FileNames
void setFilesModified(FileList *fileList)