Commit c3d61b4e authored by Oliver Bock's avatar Oliver Bock
Browse files

Remove trailing whitespaces

parent 436160b5
......@@ -155,7 +155,7 @@ string BOINCClientAdapter::applicationInformation() const
string BOINCClientAdapter::projectInformation() const
{
string temp("<project_preferences />\n");
// preferences available? (BOINC initializes them with 0)
if(m_UserData.project_preferences != 0) {
// ugly workaround for incomplete XML fragment returned by BOINC!
......
......@@ -33,13 +33,13 @@ using namespace std;
/**
* \brief Class that serves as storage container for arbitrary binary data resources
*
*
* Instances of this class are returned by ResourceFactory and hold any kind of binary data
* in the guise of a byte value vector identified by a descriptive string. You can access the
* data using \ref data() and query the identifier using \ref identifier().
*
* data using \ref data() and query the identifier using \ref identifier().
*
* \see ResourceFactory
*
*
* \author Oliver Bock\n
* Max-Planck-Institute for Gravitational Physics\n
* Hannover, Germany
......@@ -49,37 +49,37 @@ class Resource
public:
/**
* \brief Constructor
*
*
* \param identifier The string used to identify this resource
* \param data A vector of byte values used to initialize the resource's data container
*/
Resource(const string identifier, const vector<unsigned char>& data);
/// Destructor
virtual ~Resource();
/**
* \brief Retrieve the identifier of this resource
*
*
* \return The identifier of this resource
*/
string identifier() const;
/**
* \brief Retrieve the data stored in this resource
*
*
* The data can be accessed using the constant pointer returned by this method.
* The pointer points to the beginning of a byte value sequence. The length of the
* vector equals the the size of the data content.
*
*
* \return The base pointer to the data contained in this resource
*/
const vector<unsigned char> * data() const;
private:
/// The identifer of this resource
string m_Identifier;
/// The data storage container of this resource
const vector<unsigned char> m_Data;
};
......
......@@ -24,24 +24,24 @@ ResourceFactory::ResourceFactory()
{
// determine number of resources
int resourceCount = c_ResourceIndex[0][0];
// import each resource into factory cache
for(int i = 0; i < resourceCount; ++i) {
// prepare temporary buffer
size_t resourceSize = c_ResourceIndex[i+1][1];
vector<unsigned char> buffer(resourceSize);
// extract resource data from storage container
for(size_t x = 0; x < resourceSize; ++x) {
// use offset and relative position to find the absolute position
unsigned char byteValue = c_ResourceStorage[c_ResourceIndex[i+1][0] + x];
// add byte to buffer
buffer[x] = byteValue;
}
// add buffer to resource map
m_ResourceMap[c_ResourceIdentifiers[i]] = buffer;
}
......@@ -54,12 +54,12 @@ ResourceFactory::~ResourceFactory()
const Resource* ResourceFactory::createInstance(const string identifier)
{
Resource *res = NULL;
// determine whether the requested identifier exists
if(m_ResourceMap.find(identifier) != m_ResourceMap.end()) {
// we know the requested resource, create instance
res = new Resource(identifier, m_ResourceMap[identifier]);
}
return res;
}
......@@ -36,22 +36,22 @@ using namespace std;
/**
* \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:
* - \ref c_ResourceIdentifiers
* - \ref c_ResourceIndex
* - \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
* \see ResourceCompiler
*
*
* \author Oliver Bock\n
* Max-Planck-Institute for Gravitational Physics\n
* Hannover, Germany
......@@ -61,25 +61,25 @@ class ResourceFactory
public:
/// Default constructor
ResourceFactory();
/// Destructor
virtual ~ResourceFactory();
/**
* \brief Creates an instance of the requested resource
*
*
* The identifier has to be the same as the one specified in the \c *.orc file
* used to compile the resources
*
*
* \param identifier The identifer of the resource to be instantiated
*
*
* \return A constant pointer to the newly instantiated resource
* or NULL if the specified resource could not be found
*
*
* \see ResourceCompiler
*/
const Resource* createInstance(const string identifier);
private:
/// Hashtable mapping identifiers to resource data
map<string, vector<unsigned char> > m_ResourceMap;
......@@ -87,7 +87,7 @@ private:
/**
* \brief Declaration of the external list of resource identifiers
*
*
* \todo Does this need to be global?
* Maybe we should wrap a class around the generated resources?
*/
......@@ -95,13 +95,13 @@ extern const string c_ResourceIdentifiers[];
/**
* \brief Declaration of the external list of resource indices
*
*
* 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:
* -# 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?
*/
......@@ -109,11 +109,11 @@ extern const unsigned int c_ResourceIndex[][2];
/**
* \brief Declaration of the external resource storage container
*
*
* The container comprises all resources in a continuous byte sequence
* expressed as hex values. Use the resource index to locate/retrieve
* a specific resource from the container.
*
*
* \todo Does this need to be global?
* Maybe we should wrap a class around the generated resources?
*/
......
......@@ -1301,7 +1301,7 @@ float pulsar_info[][N_PULSAR_ITEMS] = {
{ 346.92f , 22.43f } ,
{ 349.29f , 14.66f } ,
{ 350.59f , 20.95f } ,
{ 356.71f , -6.17f }
{ 356.71f , -6.17f }
};
int Npulsars = sizeof(pulsar_info)/(N_PULSAR_ITEMS*sizeof(float));
......
......@@ -709,7 +709,7 @@ float star_info[][2] = {
{ 153.68447399f , -42.12206281f } , { 142.67547063f , -40.46688763f } ,
{ 142.67547063f , -40.46688763f } , { 136.99907126f , -43.43262406f } ,
{ 136.99907126f , -43.43262406f } , { 122.38314727f , -47.33661177f } ,
};
};
int Nstars = sizeof(star_info)/(2*sizeof(float)) ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment