Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
graphicsframework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Oliver Behnke
graphicsframework
Commits
99ef026d
Commit
99ef026d
authored
17 years ago
by
Oliver Bock
Browse files
Options
Downloads
Patches
Plain Diff
Even more doxygen updates
parent
a04c14ee
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ResourceFactory.h
+8
-15
8 additions, 15 deletions
ResourceFactory.h
orc/ResourceCompiler.h
+65
-1
65 additions, 1 deletion
orc/ResourceCompiler.h
with
73 additions
and
16 deletions
ResourceFactory.h
+
8
−
15
View file @
99ef026d
...
...
@@ -8,19 +8,18 @@
#include
"Resource.h"
/**
* \brief This factory instantiates Resource objects using a given identifier
* \brief This factory instantiates
%
Resource objects using a given identifier
*
* During contruction of the factory object itself it loads all available resources into
* an internal cache. The user can subsequently request a copy of this resource by specifying
* it using the resource's identifier.
*
* The resource data is expected to be stored in these three externally linked arrays:
* <ul>
* <li>\ref c_ResourceIdentifiers</li>
* <li>\ref c_ResourceIndex</li>
* <li>\ref c_ResourceStorage</li>
* </ul>
* These arrays are compiled using the Open Resource Compiler (ORC) which can be found
* - \ref c_ResourceIdentifiers
* - \ref c_ResourceIndex
* - \ref c_ResourceStorage
*
* These arrays are compiled using the Open %Resource Compiler (ORC) which can be found
* in the \c orc subdirectory.
*
* \see Resource
...
...
@@ -73,12 +72,8 @@ extern const string c_ResourceIdentifiers[];
* This two-dimensional array contains the necessary indices for
* every resource in the storage container. Using these indices you
* can easily extract a requested resource:
* <ol>
* <li>Offset to the resource</li>
* <li>Length of the resource</li>
* </ol>
*
* \see c_ResourceStorage
* -# Offset to the resource
* -# Length of the resource
*
* \todo Does this need to be global?
* Maybe we should wrap a class around the generated resources?
...
...
@@ -92,8 +87,6 @@ extern const unsigned int c_ResourceIndex[][2];
* expressed as hex values. Use the resource index to locate/retrieve
* a specific resource from the container.
*
* \see c_ResourceIndex
*
* \todo Does this need to be global?
* Maybe we should wrap a class around the generated resources?
*/
...
...
This diff is collapsed.
Click to expand it.
orc/ResourceCompiler.h
+
65
−
1
View file @
99ef026d
...
...
@@ -11,22 +11,86 @@
using
namespace
std
;
/**
* \brief Helper class that converts binary resources into source code ready for compilation
*
* This "compiler" takes a resource specification file, opens and loads the physical
* files and converts their contents into normal C/C++ source code. The source code
* comprises three arrays which can be subsequently compiled into object code which is
* then referenced by ResourceFactory using external linkage.
* \n
* %Resource specification file format:
* - Each line describes one resource
* - The descriptor has to look like this: LogicalResourceName|PhysicalResourceName
* - Lines starting with # are treated as comments
* - Empty lines are ignored
*
* As you can see the logical and the physical (file) resource name are delimited by the pipe (|) character.
* The logical resource name will be used again later. It is the identifier used to request a resource via
* ResourceFactory::createInstance()
*
* \see ResourceFactory
* \see ResourceFactory::c_ResourceIdentifiers
* \see ResourceFactory::c_ResourceIndex
* \see ResourceFactory::c_ResourceStorage
*/
class
ResourceCompiler
{
public:
/**
* \brief Constructor
*
* \param inputFilename Name of the resource specification file (source, \c *.orc)
* \param outputFilename Name of the converted recources file (destination, \c *.cpp)
*/
ResourceCompiler
(
const
string
inputFilename
,
const
string
outputFilename
);
/// Destructor
virtual
~
ResourceCompiler
();
/**
* \brief Converts the specified resources into the specified source code file
*
* It iterates over all resources found in the local cache and stores their data
* and meta information as source code in the destination file. Thus parseInputFile()
* and loadBinaryData() have to be called first for this to work.
*
* \see parseInputFile
* \see loadBinaryData
*/
void
compile
();
private:
/**
* \brief Parses the specified input file
*
* After validating the resource specification file its contents are
* stored for later use.
*
* \see loadBinaryData
*/
void
parseInputFile
();
/**
* \brief Loads binary resource file data into the local cache
*
* This methods tries to open all resource files found by loadBinaryData()
* and copies their binary data into the local cache.
*
* \see parseInputFile
*/
void
loadBinaryData
();
/// Path and filename of the resource specification file (source)
string
m_ResourceSpecFile
;
/// Path and filename of the converted source code file (destination)
string
m_ResourceCodeFile
;
/// Mapping between logical and physical resource names
map
<
string
,
string
>
m_ResourceFileMap
;
/// %Resource cache (identified by logical resource name)
map
<
string
,
vector
<
unsigned
char
>
>
m_ResourceDataMap
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment