Linux multi-monitor fullscreen support
[ryzomcore.git] / nel / tools / 3d / pipeline_max / dll_directory.h
blobb30feef5a1ccf6479fea993da0abc5cb76ba5ad3
1 /**
2 * \file dll_directory.h
3 * \brief CDllDirectory
4 * \date 2012-08-18 09:01GMT
5 * \author Jan Boon (Kaetemi)
6 * CDllDirectory
7 */
9 /*
10 * Copyright (C) 2012 by authors
12 * This file is part of RYZOM CORE PIPELINE.
13 * RYZOM CORE PIPELINE is free software: you can redistribute it
14 * and/or modify it under the terms of the GNU Affero General Public
15 * License as published by the Free Software Foundation, either
16 * version 3 of the License, or (at your option) any later version.
18 * RYZOM CORE PIPELINE is distributed in the hope that it will be
19 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
20 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Affero General Public License for more details.
23 * You should have received a copy of the GNU Affero General Public
24 * License along with RYZOM CORE PIPELINE. If not, see
25 * <http://www.gnu.org/licenses/>.
28 #ifndef PIPELINE_DLL_DIRECTORY_H
29 #define PIPELINE_DLL_DIRECTORY_H
30 #include <nel/misc/types_nl.h>
32 // STL includes
34 // NeL includes
36 // Project includes
37 #include "storage_object.h"
38 #include "storage_value.h"
39 #include "dll_plugin_desc.h"
41 namespace PIPELINE {
42 namespace MAX {
44 /**
45 * \brief CDllEntry
46 * \date 2012-08-18 09:01GMT
47 * \author Jan Boon (Kaetemi)
48 * CDllEntry
50 class CDllEntry : public CStorageContainer
52 public:
53 CDllEntry();
54 CDllEntry(const IDllPluginDescInternal *dllPluginDesc);
55 virtual ~CDllEntry();
57 // inherited
58 virtual std::string className() const;
59 virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
60 virtual void parse(uint16 version, uint filter = 0);
61 virtual void clean();
62 virtual void build(uint16 version, uint filter = 0);
63 virtual void disown();
65 // read access
66 const ucstring &dllDescription() const { return m_DllDescription->Value; }
67 const ucstring &dllFilename() const { return m_DllFilename->Value; }
69 // debug
70 void overrideDllFilename(const ucstring &dllFilename) { m_DllFilename->Value = dllFilename; }
72 protected:
73 virtual IStorageObject *createChunkById(uint16 id, bool container);
74 CStorageValue<ucstring> *m_DllDescription;
75 CStorageValue<ucstring> *m_DllFilename;
77 }; /* class CDllDirectory */
79 /**
80 * \brief CDllDirectory
81 * \date 2012-08-18 09:01GMT
82 * \author Jan Boon (Kaetemi)
83 * This class is used for parsing the local dll indices in a max file,
84 * both reading and writing is supported. It is not used at runtime,
85 * and should be reset when no longer necessary. Plugins have their own
86 * copy of the actual IDllPluginDescInternal. This class only contains
87 * CDllEntry instances, which should not be used directly. The instance
88 * of this class used to parse the max file should be kept, as there
89 * might be chunks that were not parsed, which should be rewritten to
90 * the stream.
92 class CDllDirectory : public CStorageContainer
94 public:
95 CDllDirectory();
96 virtual ~CDllDirectory();
98 // inherited
99 virtual std::string className() const;
100 virtual void toString(std::ostream &ostream, const std::string &pad = "") const;
101 virtual void parse(uint16 version, uint filter = 0);
102 virtual void clean();
103 virtual void build(uint16 version, uint filter = 0);
104 virtual void disown();
106 // public
107 // Get a dll entry corresponding to a chunk index, pointers become invalid after reset
108 const CDllEntry *get(sint32 index) const;
109 // Reset the dll directory, all dll entry pointers become invalid, use internal name and dll plugin registry
110 void reset();
111 // Get or create the chunk index for a dll by dll plugin description
112 sint32 getOrCreateIndex(const IDllPluginDescInternal *dllPluginDesc);
114 private:
115 void addInternalIndices();
117 protected:
118 virtual IStorageObject *createChunkById(uint16 id, bool container);
120 private:
121 TStorageObjectContainer m_ChunkCache;
122 std::vector<CDllEntry *> m_Entries;
123 std::map<ucstring, sint32> m_InternalNameToIndex;
125 const CDllEntry m_DllEntryBuiltin;
126 const CDllEntry m_DllEntryScript;
128 }; /* class CDllDirectory */
130 } /* namespace MAX */
131 } /* namespace PIPELINE */
133 #endif /* #ifndef PIPELINE_DLL_DIRECTORY_H */
135 /* end of file */