2 * \file dll_directory.h
4 * \date 2012-08-18 09:01GMT
5 * \author Jan Boon (Kaetemi)
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>
37 #include "storage_object.h"
38 #include "storage_value.h"
39 #include "dll_plugin_desc.h"
46 * \date 2012-08-18 09:01GMT
47 * \author Jan Boon (Kaetemi)
50 class CDllEntry
: public CStorageContainer
54 CDllEntry(const IDllPluginDescInternal
*dllPluginDesc
);
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);
62 virtual void build(uint16 version
, uint filter
= 0);
63 virtual void disown();
66 const ucstring
&dllDescription() const { return m_DllDescription
->Value
; }
67 const ucstring
&dllFilename() const { return m_DllFilename
->Value
; }
70 void overrideDllFilename(const ucstring
&dllFilename
) { m_DllFilename
->Value
= dllFilename
; }
73 virtual IStorageObject
*createChunkById(uint16 id
, bool container
);
74 CStorageValue
<ucstring
> *m_DllDescription
;
75 CStorageValue
<ucstring
> *m_DllFilename
;
77 }; /* class CDllDirectory */
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
92 class CDllDirectory
: public CStorageContainer
96 virtual ~CDllDirectory();
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();
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
111 // Get or create the chunk index for a dll by dll plugin description
112 sint32
getOrCreateIndex(const IDllPluginDescInternal
*dllPluginDesc
);
115 void addInternalIndices();
118 virtual IStorageObject
*createChunkById(uint16 id
, bool container
);
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 */