Commit a88ef2ba authored by Eric Bruneton's avatar Eric Bruneton
Browse files

patch from Sergej Forat

git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/ork/trunk@33 28599a00-4e59-401b-b2d8-d34d4661a6c9
parent f37d5101
......@@ -31,6 +31,7 @@
#include "examples/Main.h"
using namespace std;
using namespace ork;
struct P3_N3_UV_C {
......
......@@ -31,6 +31,7 @@
#include "examples/Main.h"
using namespace std;
using namespace ork;
class ResourceExample : public GlutWindow
......
......@@ -34,6 +34,7 @@
#include "examples/Main.h"
using namespace std;
using namespace ork;
class SceneGraphExample : public GlutWindow
......
......@@ -34,6 +34,7 @@
#include "examples/Main.h"
using namespace std;
using namespace ork;
class SceneGraphResourceExample : public GlutWindow
......
......@@ -28,8 +28,6 @@
#include "ork/core/Object.h"
using namespace std;
namespace ork
{
......@@ -83,7 +81,7 @@ private:
* keys. Each object has a reference counter used to automatically destroy
* objects when they are no longer used.
*/
map< K, pair<C, int> > values;
std::map< K, std::pair<C, int> > values;
};
template <typename K, typename C>
......@@ -96,7 +94,7 @@ C Factory<K, C>::get(K key)
{
C result;
int uses;
typename map< K, pair<C, int> >::iterator i = values.find(key);
typename std::map< K, std::pair<C, int> >::iterator i = values.find(key);
if (i == values.end()) {
// if the objet does not exist yet, we create it
result = ctor(key);
......@@ -106,14 +104,14 @@ C Factory<K, C>::get(K key)
result = i->second.first;
uses = i->second.second + 1;
}
values.insert(make_pair(key, make_pair(result, uses)));
values.insert(std::make_pair(key, std::make_pair(result, uses)));
return result;
}
template <typename K, typename C>
void Factory<K, C>::put(K key)
{
typename map< K, pair<C, int> >::iterator i = values.find(key);
typename std::map< K, std::pair<C, int> >::iterator i = values.find(key);
if (i != values.end()) {
C value = i->second.first;
int uses = i->second.second - 1;
......@@ -123,7 +121,7 @@ void Factory<K, C>::put(K key)
// smart pointers
values.erase(i);
} else {
values.insert(make_pair(key, make_pair(value, uses)));
values.insert(std::make_pair(key, std::make_pair(value, uses)));
}
}
}
......
......@@ -28,6 +28,8 @@
#include <pthread.h>
#include <string.h>
using namespace std;
namespace ork
{
......
......@@ -51,13 +51,13 @@ public:
/**
* Creates a new File with the given file name.
*/
File(const string &name);
File(const std::string &name);
private:
/**
* The stream used to write in this file.
*/
fstream stream;
std::fstream stream;
/**
* The file size just after the penultimate flush has been done.
......@@ -102,7 +102,7 @@ public:
* @param out the File to which messages must be logged.
* @param next the logger to which messages must be forwarded after logging by this logger.
*/
FileLogger(const string &type, File *out, ptr<Logger> next = NULL);
FileLogger(const std::string &type, File *out, ptr<Logger> next = NULL);
/**
* Destroys this logger.
......@@ -112,7 +112,7 @@ public:
/**
* Writes the given message to the file used by this logger.
*/
virtual void log(const string &topic, const string &msg);
virtual void log(const std::string &topic, const std::string &msg);
/**
* Flushes the buffer of the file used by this logger.
......
......@@ -27,8 +27,6 @@
#include <set>
#include <map>
using namespace std;
namespace ork
{
......@@ -48,7 +46,7 @@ public:
/**
* Creates a set iterator for the given set.
*/
SetIterator(set<type> &c);
SetIterator(std::set<type> &c);
/**
* Returns the size of the set for which this iterator has been created.
......@@ -75,17 +73,17 @@ private:
/**
* The current iterator position.
*/
typename set<type>::iterator i;
typename std::set<type>::iterator i;
/**
* The iterator position corresponding to the end of the set.
*/
typename set<type>::iterator end;
typename std::set<type>::iterator end;
/**
* The empty set used for creating empty iterators.
*/
static set<type> emptySet;
static std::set<type> emptySet;
};
/**
......@@ -104,7 +102,7 @@ public:
/**
* Creates a map iterator for the given map.
*/
MapIterator(map<key, type> &c);
MapIterator(std::map<key, type> &c);
/**
* Returns the size of the map for which this iterator has been created.
......@@ -139,17 +137,17 @@ private:
/**
* The current iterator position.
*/
typename map<key,type>::iterator i;
typename std::map<key,type>::iterator i;
/**
* The iterator position corresponding to the end of the map.
*/
typename map<key,type>::iterator end;
typename std::map<key,type>::iterator end;
/**
* The empty map used for creating empty iterators.
*/
static map<key,type> emptyMap;
static std::map<key,type> emptyMap;
};
/**
......@@ -168,13 +166,13 @@ public:
/**
* Creates a multimap iterator for the given multimap.
*/
MultiMapIterator(multimap<key, type> &c);
MultiMapIterator(std::multimap<key, type> &c);
/**
* Creates a multimap iterator for the values associated with the given key
* in the given multimap.
*/
MultiMapIterator(key k, multimap<key, type> &c);
MultiMapIterator(key k, std::multimap<key, type> &c);
/**
* Returns the size of the multimap for which this iterator has been created.
......@@ -207,17 +205,17 @@ private:
/**
* The current iterator position.
*/
typename multimap<key,type>::iterator i;
typename std::multimap<key,type>::iterator i;
/**
* The iterator position corresponding to the end of the multimap.
*/
typename multimap<key,type>::iterator end;
typename std::multimap<key,type>::iterator end;
/**
* The empty multimap used for creating empty iterators.
*/
static multimap<key,type> emptyMap;
static std::multimap<key,type> emptyMap;
};
template <typename type>
......@@ -226,7 +224,7 @@ SetIterator<type>::SetIterator() : n(0), i(emptySet.begin()), end(emptySet.end()
}
template <typename type>
SetIterator<type>::SetIterator(set<type> &c) : n((unsigned int)c.size()), i(c.begin()), end(c.end())
SetIterator<type>::SetIterator(std::set<type> &c) : n((unsigned int)c.size()), i(c.begin()), end(c.end())
{
}
......@@ -249,7 +247,7 @@ type SetIterator<type>::next()
}
template <typename type>
set<type> SetIterator<type>::emptySet;
std::set<type> SetIterator<type>::emptySet;
template <typename key, typename type>
MapIterator<key, type>::MapIterator() : n(0), i(emptyMap.begin()), end(emptyMap.end())
......@@ -257,7 +255,7 @@ MapIterator<key, type>::MapIterator() : n(0), i(emptyMap.begin()), end(emptyMap.
}
template <typename key, typename type>
MapIterator<key, type>::MapIterator(map<key, type> &c) : n((unsigned int)c.size()), i(c.begin()), end(c.end())
MapIterator<key, type>::MapIterator(std::map<key, type> &c) : n((unsigned int)c.size()), i(c.begin()), end(c.end())
{
}
......@@ -287,7 +285,7 @@ type MapIterator<key, type>::next(key &k)
}
template <typename key, typename type>
map<key,type> MapIterator<key, type>::emptyMap;
std::map<key,type> MapIterator<key, type>::emptyMap;
template <typename key, typename type>
MultiMapIterator<key, type>::MultiMapIterator() : n(0), i(emptyMap.begin()), end(emptyMap.end())
......@@ -295,14 +293,14 @@ MultiMapIterator<key, type>::MultiMapIterator() : n(0), i(emptyMap.begin()), end
}
template <typename key, typename type>
MultiMapIterator<key, type>::MultiMapIterator(multimap<key, type> &c) : n(c.size()), i(c.begin()), end(c.end())
MultiMapIterator<key, type>::MultiMapIterator(std::multimap<key, type> &c) : n(c.size()), i(c.begin()), end(c.end())
{
}
template <typename key, typename type>
MultiMapIterator<key, type>::MultiMapIterator(key k, multimap<key, type> &c)
MultiMapIterator<key, type>::MultiMapIterator(key k, std::multimap<key, type> &c)
{
std::pair<typename multimap<key, type>::iterator, typename multimap<key, type>::iterator> p;
std::pair<typename std::multimap<key, type>::iterator, typename std::multimap<key, type>::iterator> p;
p = c.equal_range(k);
n = (unsigned int) c.count(k);
i = p.first;
......@@ -335,7 +333,7 @@ type MultiMapIterator<key, type>::next(key &k)
}
template <typename key, typename type>
multimap<key,type> MultiMapIterator<key, type>::emptyMap;
std::multimap<key,type> MultiMapIterator<key, type>::emptyMap;
}
......
......@@ -29,6 +29,8 @@
#include <cstdarg>
#include <cstdio>
using namespace std;
namespace ork
{
......
......@@ -64,7 +64,7 @@ public:
/**
* Creates a new logger of the given type (debug, info, warning, etc).
*/
Logger(const string &type);
Logger(const std::string &type);
/**
* Destroys this logger.
......@@ -77,19 +77,19 @@ public:
* least one topic is selected by this method, only messages whose topic
* has been selected by this method will be logged.
*/
void addTopic(const string &topic);
void addTopic(const std::string &topic);
/**
* Returns true if messages of the given topic are logged by this logger.
*/
bool hasTopic(const string &topic);
bool hasTopic(const std::string &topic);
/**
* Logs a message given by its topic and its content. The default
* implementation of this method sends the message to the standard error
* output stream cerr.
*/
virtual void log(const string &topic, const string &msg);
virtual void log(const std::string &topic, const std::string &msg);
/**
* Formatted logging for more usability.
......@@ -111,13 +111,13 @@ protected:
/**
* The type of this logger (debug, info, warning, error, etc).
*/
const string type;
const std::string type;
/**
* The topics handled by this logger, separated by semi-columns.
* An empty string means that all topics are handled.
*/
string topics;
std::string topics;
/**
* A mutex to access this logger from multiple threads.
......
......@@ -30,6 +30,8 @@
#include "ork/core/Logger.h"
using namespace std;
void fopen(FILE **f, const char* fileName, const char *mode)
{
#ifdef _MSC_VER
......
......@@ -48,8 +48,6 @@
#define NULL 0
#endif
using namespace std;
// ---------------------------------------------------------------------------
// Static and dynamic assertions
// ---------------------------------------------------------------------------
......@@ -131,7 +129,7 @@ public:
/**
* Returns a set containing all instances of a class, or NULL is non was created.
*/
static set<Object*>* findAllInstances(const char* className);
static std::set<Object*>* findAllInstances(const char* className);
#endif
protected:
......@@ -240,7 +238,7 @@ private:
/**
* The number of objects currently allocated in memory, for each class.
*/
static map<char*, int> *counts;
static std::map<char*, int> *counts;
#endif
#ifdef KEEP_OBJECT_REFERENCES
......
......@@ -30,8 +30,6 @@
#include "pmath.h"
#include "ork/math/vec2.h"
using namespace std;
namespace ork
{
......
......@@ -29,8 +29,6 @@
#include "ork/math/vec3.h"
using namespace std;
namespace ork
{
......
......@@ -36,6 +36,8 @@
#include "ork/render/Module.h"
#include "ork/render/Texture.h"
using namespace std;
inline void glEnable(GLenum p, bool b)
{
if (b) {
......
......@@ -45,8 +45,6 @@
#include "ork/render/TextureRectangle.h"
#include "ork/render/TransformFeedback.h"
using namespace std;
namespace ork
{
......@@ -1535,7 +1533,7 @@ private:
{
}
map< void*, ptr<FrameBuffer> > buffers;
std::map< void*, ptr<FrameBuffer> > buffers;
};
/**
......
......@@ -30,6 +30,8 @@
#include "ork/core/Logger.h"
#include "ork/render/FrameBuffer.h"
using namespace std;
// glMapBuffer and glUnmapBuffer seem inefficient.
// This option avoids theses calls by using a copy of
// the buffer data on CPU.
......
......@@ -154,7 +154,7 @@ private:
/**
* Identifiers of the programs that use this buffer as a uniform block.
*/
mutable vector<GLuint> programIds;
mutable std::vector<GLuint> programIds;
/**
* Adds the given program as a user of this buffer as a uniform block.
......@@ -169,7 +169,7 @@ private:
/**
* Returns true if one of the given programs uses this buffer as a uniform block.
*/
bool isUsedBy(const vector<GLuint> &programIds) const;
bool isUsedBy(const std::vector<GLuint> &programIds) const;
/**
* Binds this buffer to a uniform block binding unit not currently used
......@@ -183,7 +183,7 @@ private:
* bound, or -1 if no unit was available (meaning that the program
* uses too much uniform blocks).
*/
GLint bindToUniformBufferUnit(const vector<GLuint> &programIds) const;
GLint bindToUniformBufferUnit(const std::vector<GLuint> &programIds) const;
friend class UniformBufferUnit;
......
......@@ -30,8 +30,6 @@
#include "ork/render/GPUBuffer.h"
#include "ork/render/MeshBuffers.h"
using namespace std;
namespace ork
{
......
......@@ -30,6 +30,8 @@
#include "ork/render/FrameBuffer.h"
#include "ork/resource/ResourceTemplate.h"
using namespace std;
namespace ork
{
......
Supports Markdown
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