Reformatting.

This commit is contained in:
Maciej Suminski 2013-08-08 14:59:59 +02:00
parent 282995eaee
commit 12e10fd43a
5 changed files with 151 additions and 159 deletions

View File

@ -64,10 +64,12 @@ struct TOOL_MANAGER::ToolState
std::vector<Transition> transitions; std::vector<Transition> transitions;
}; };
TOOL_MANAGER::TOOL_MANAGER() TOOL_MANAGER::TOOL_MANAGER()
{ {
} }
void TOOL_MANAGER::RegisterTool( TOOL_BASE* aTool ) void TOOL_MANAGER::RegisterTool( TOOL_BASE* aTool )
{ {
ToolState* st = new ToolState; ToolState* st = new ToolState;

View File

@ -53,10 +53,9 @@
*/ */
template<class ReturnType, class ArgType> template<class ReturnType, class ArgType>
class COROUTINE { class COROUTINE
{
public: public:
COROUTINE() COROUTINE()
{ {
m_stackSize = c_defaultStackSize; m_stackSize = c_defaultStackSize;
@ -68,15 +67,10 @@ public:
* Constructor * Constructor
* Creates a coroutine from a member method of an object * Creates a coroutine from a member method of an object
*/ */
template<class T> template<class T>
COROUTINE( T* object, ReturnType (T::*ptr)( ArgType ) ) : COROUTINE( T* object, ReturnType (T::*ptr)( ArgType ) ) :
m_func (object, ptr), m_func( object, ptr ), m_saved( NULL ), m_stack( NULL ), m_stackSize( c_defaultStackSize )
m_saved(NULL),
m_stack(NULL),
m_stackSize(c_defaultStackSize)
{ {
} }
/** /**
@ -84,10 +78,7 @@ public:
* Creates a coroutine from a delegate object * Creates a coroutine from a delegate object
*/ */
COROUTINE( DELEGATE<ReturnType, ArgType> aEntry ) : COROUTINE( DELEGATE<ReturnType, ArgType> aEntry ) :
m_func(aEntry), m_func( aEntry ), m_saved( NULL ), m_stack( NULL ), m_stackSize( c_defaultStackSize )
m_saved(NULL),
m_stack(NULL),
m_stackSize(c_defaultStackSize)
{}; {};
~COROUTINE() ~COROUTINE()
@ -190,7 +181,6 @@ public:
} }
private: private:
static const int c_defaultStackSize = 2000000; static const int c_defaultStackSize = 2000000;
/* real entry point of the coroutine */ /* real entry point of the coroutine */
@ -207,15 +197,16 @@ private:
boost::context::jump_fcontext( cor->m_self, cor->m_saved, 0 ); //reinterpret_cast<intptr_t>( this )); boost::context::jump_fcontext( cor->m_self, cor->m_saved, 0 ); //reinterpret_cast<intptr_t>( this ));
} }
template <typename T> struct strip_ref { template <typename T> struct strip_ref
{
typedef T result; typedef T result;
}; };
template <typename T> struct strip_ref<T&> { template <typename T> struct strip_ref<T&>
{
typedef T result; typedef T result;
}; };
DELEGATE<ReturnType, ArgType> m_func; DELEGATE<ReturnType, ArgType> m_func;
///< pointer to coroutine entry arguments. Stripped of references ///< pointer to coroutine entry arguments. Stripped of references

View File

@ -51,7 +51,6 @@ class wxWindow;
class TOOL_MANAGER class TOOL_MANAGER
{ {
public: public:
TOOL_MANAGER(); TOOL_MANAGER();
~TOOL_MANAGER(); ~TOOL_MANAGER();