Commit a4fd2092 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Updating headers for 2017 and style

parent ae71d766
......@@ -11,8 +11,8 @@
* --------------------------------------------------------------------------------------------
*/
#ifndef VA_INCLUDE_GUARD_VACORE_DEFINITIONS
#define VA_INCLUDE_GUARD_VACORE_DEFINITIONS
#ifndef IW_VACORE_DEFINITIONS
#define IW_VACORE_DEFINITIONS
#include <string>
#include <vector>
......@@ -32,4 +32,4 @@
#pragma warning( disable: 4251 )
#endif
#endif // VA_INCLUDE_GUARD_VACORE_DEFINITIONS
#endif // IW_VACORE_DEFINITIONS
......@@ -11,8 +11,8 @@
* ---------------------------------------------------------------------------------
*/
#ifndef INCLUDE_WATCHER_VA_COREFACTORY_H
#define INCLUDE_WATCHER_VA_COREFACTORY_H
#ifndef IW_VACORE_CORE_FACTORY
#define IW_VACORE_CORE_FACTORY
#include <VACoreDefinitions.h>
#include <VAStruct.h>
......@@ -41,4 +41,4 @@ namespace VACore
} // End of namespace "VACore"
#endif // INCLUDE_WATCHER_VA_COREFACTORY_H
#endif // IW_VACORE_CORE_FACTORY
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* File: VAObjectPool.h
*
* Purpose: Object pool class
*
* Author(s): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
* --------------------------------------------------------------------------------------------
*/
#ifndef __VA_OBJECTPOOL_H__
#define __VA_OBJECTPOOL_H__
#ifndef IW_VACORE_OBJECT_POOL
#define IW_VACORE_OBJECT_POOL
#include <VACoreDefinitions.h>
......@@ -43,7 +36,7 @@ class IVAPoolObjectFactory;
*
* Creation and deletion of objects is abstracted and is implemented in a way that
* reusage is lightweight and effizient. Usage/Links of objects is realised by
* reference counters. A release is triggert, if an object does not have any
* reference counters. A release is triggert, if an object does not have any
* remaining references.
*
* The pool creates object by using a factory that has to be provided. Therefore,
......@@ -52,7 +45,8 @@ class IVAPoolObjectFactory;
*
* \note Not thread safe, thread safety has to be provided by user
*/
class VACORE_API IVAObjectPool : public IVAUncopyable {
class VACORE_API IVAObjectPool : public IVAUncopyable
{
public:
//! Factory method
/**
......@@ -63,7 +57,7 @@ public:
*
* \return Pointer to the newly created pool of unused objects
*/
static IVAObjectPool* Create(int iInitialSize, int iDelta, IVAPoolObjectFactory* pFactory, bool bDeleteFactory);
static IVAObjectPool* Create( int iInitialSize, int iDelta, IVAPoolObjectFactory* pFactory, bool bDeleteFactory );
//! Destructor
virtual ~IVAObjectPool() {};
......@@ -72,32 +66,32 @@ public:
/**
* Set name of the pool (for debugging purposes only)
*/
virtual void SetName(const std::string& sName)=0;
virtual void SetName( const std::string& sName ) = 0;
//! Reset
/**
* Resets pool by quick reference removal of all objects. Does not
* change size of pool.
*/
virtual void Reset()=0;
virtual void Reset() = 0;
//! Number of free object slots
/**
* \return Number of free objects that can be requested
*/
virtual int GetNumFree() const=0;
virtual int GetNumFree() const = 0;
//! Number of used object slots
/**
* \return Number of used objects that can be requested
*/
virtual int GetNumUsed() const=0;
virtual int GetNumUsed() const = 0;
//! Pool size getter
/**
* \return Number of available slots for objects
*/
virtual int GetSize() const=0;
virtual int GetSize() const = 0;
//! Increase pool size
/**
......@@ -105,7 +99,7 @@ public:
*
* \param Returns number of created object slots (iDelta)
*/
virtual int Grow(int iDelta)=0;
virtual int Grow( int iDelta ) = 0;
//! Request a free object slot in pool
/**
......@@ -113,14 +107,14 @@ public:
*
* \return Pointer to the new object
*/
virtual CVAPoolObject* RequestObject()=0;
virtual CVAPoolObject* RequestObject() = 0;
protected:
//! Release-Hook (used by IVAPoolObject implementations)
/**
* Releases object to the pool if no reference available anymore
*/
virtual void ReleaseObject(CVAPoolObject* pObject)=0;
virtual void ReleaseObject( CVAPoolObject* pObject ) = 0;
// Access for CVAPoolObject to RemoveReference()
friend class CVAPoolObject;
......@@ -136,7 +130,8 @@ protected:
* for new usage (recycling). The object releases itself to
* the pool if no references are existent.
*/
class VACORE_API CVAPoolObject : public IVAUncopyable, public CVAReferenceableObject {
class VACORE_API CVAPoolObject : public IVAUncopyable, public CVAReferenceableObject
{
public:
//! Redefined method to remove reference
/**
......@@ -163,7 +158,7 @@ protected:
* The PreRequest method is called before the object is used
*/
virtual void PreRequest() {};
//! Pre release method
/**
* The PreRelease method is called after the object has been released
......@@ -182,17 +177,18 @@ private:
/**
* Interface for the creation of a pool object (factory method)
*/
class VACORE_API IVAPoolObjectFactory {
class VACORE_API IVAPoolObjectFactory
{
public:
virtual ~IVAPoolObjectFactory() {};
inline virtual ~IVAPoolObjectFactory() {};
//! Factory method (abstract)
/**
* Interface method to create a new pool object
*
*
* \return Pointer to the new pool object
*/
virtual CVAPoolObject* CreatePoolObject()=0;
virtual CVAPoolObject* CreatePoolObject() = 0;
};
......@@ -200,7 +196,8 @@ public:
/**
* Pool object factory for objects using the default constructor
*/
template<class T> class CVAPoolObjectDefaultFactory : public IVAPoolObjectFactory {
template< class T > class CVAPoolObjectDefaultFactory : public IVAPoolObjectFactory
{
public:
//! Factory method
/**
......@@ -208,7 +205,10 @@ public:
*
* \return Pointer to the new pool object
*/
virtual CVAPoolObject* CreatePoolObject() { return new T; }
inline virtual CVAPoolObject* CreatePoolObject()
{
return new T;
}
};
#endif // __VA_OBJECTPOOL_H__
\ No newline at end of file
#endif // IW_VACORE_OBJECT_POOL
\ No newline at end of file
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* File: VAReferenceableObject.h
*
* Purpose: Base class for referencable objects
*
* Author(s): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
* --------------------------------------------------------------------------------------------
*/
// $Id: VAReferenceableObject.h 2729 2012-06-26 13:23:36Z fwefers $
#ifndef __VA_REFERENCEABLE_OBJECT_H__
#define __VA_REFERENCEABLE_OBJECT_H__
......
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA), 2015-2017
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* File: VAUncopyable.h
*
* Purpose: Suppress copy actions of objects
*
* Author(s): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
* --------------------------------------------------------------------------------------------
*/
// $Id: VAUncopyable.h 1790 2011-04-12 20:08:07Z stienen $
#ifndef __VA_UNCOPYABLE_H__
#define __VA_UNCOPYABLE_H__
#ifndef IW_VACORE_UNCOPYABLE
#define IW_VACORE_UNCOPYABLE
#include <VACoreDefinitions.h>
......@@ -30,20 +22,21 @@
/**
* Derive your class from VAUncopyable to block any copy instruction.
*/
class VACORE_API IVAUncopyable {
class VACORE_API IVAUncopyable
{
protected:
//! For subclasses: standard constructor available
IVAUncopyable() {};
inline IVAUncopyable() {};
//! For subclasses: destructor available
virtual ~IVAUncopyable() {};
inline virtual ~IVAUncopyable() {};
private:
//! Forbidden for everyone: copy constructor
IVAUncopyable(const IVAUncopyable&) {};
inline IVAUncopyable( const IVAUncopyable& ) {};
//! Forbidden for everyone: assignment operator
IVAUncopyable& operator=(const IVAUncopyable&);
IVAUncopyable& operator=( const IVAUncopyable& );
};
#endif // __VA_UNCOPYABLE_H__
\ No newline at end of file
#endif // IW_VACORE_UNCOPYABLE
\ No newline at end of file
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