From 0f31efcc6cfc0520596574dea4cf6cad79e4a0ec Mon Sep 17 00:00:00 2001 From: kohait Date: Thu, 4 Aug 2011 21:02:18 +0000 Subject: [PATCH] bazaar: Dispatcher cleanup and fixes git-svn-id: svn://ultimatepp.org/upp/trunk@3737 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- bazaar/Dispatcher/Dispatcher.cpp | 69 +--------- bazaar/Dispatcher/Dispatcher.h | 135 ++++++++++---------- bazaar/Dispatcher/Dispatcher.hpp | 159 ++++++++---------------- bazaar/DispatcherTest/DispatcherTest.h | 2 +- bazaar/DispatcherTest/main.cpp | 2 +- bazaar/DispatcherTest2/DispatcherTest.h | 4 +- bazaar/DispatcherTest2/main.cpp | 4 +- bazaar/DispatcherTest3/DispatcherTest.h | 4 +- bazaar/DispatcherTest3/main.cpp | 4 +- bazaar/DispatcherTest4/DispatcherTest.h | 8 +- bazaar/DispatcherTest4/main.cpp | 4 +- bazaar/DispatcherTest5/DispatcherTest.h | 8 +- bazaar/DispatcherTest5/main.cpp | 4 +- bazaar/DispatcherTest6/DispatcherTest.h | 8 +- bazaar/DispatcherTest6/main.cpp | 4 +- 15 files changed, 150 insertions(+), 269 deletions(-) diff --git a/bazaar/Dispatcher/Dispatcher.cpp b/bazaar/Dispatcher/Dispatcher.cpp index 43c210b5d..aba27bd3a 100644 --- a/bazaar/Dispatcher/Dispatcher.cpp +++ b/bazaar/Dispatcher/Dispatcher.cpp @@ -1,45 +1,12 @@ #include "Dispatcher.hpp" -DispatcherGen::DispatcherGen() -{ -} - -DispatcherGen::~DispatcherGen() -{ - //ASSERT(dests.IsEmpty()); //FIXME, DispatcherGen does keep the Dispatcher instances, cause Dispatchable are Register()ed there (forwarded) and do Unregister() only there as well. -} - - -//Callback variant - -DispatcherCBGen::DispatcherCBGen() -{ -} - -DispatcherCBGen::~DispatcherCBGen() -{ - //ASSERT(dests.IsEmpty()); //FIXME, DispatcherGen does keep the Dispatcher instances, cause Dispatchable are Register()ed there (forwarded) and do Unregister() only there as well. -} - //Dispatcher0 -Dispatcher0::Dispatcher0() -{ -} - -Dispatcher0::~Dispatcher0() -{ - ASSERT(dests.IsEmpty()); -} - void Dispatcher0::DoDispatch() const { if(!R::IsEnabled()) return; for(int i = 0; i < dests.GetCount(); i++) - { - const Callback & dest = dests.operator[](i); - dest(); - } + dests[i](); } void Dispatcher0::Register(Callback d, unsigned key) @@ -60,43 +27,17 @@ Callback* Dispatcher0::GetDispatchable(unsigned key) { int i = dests.Find(key); if(i<0) return NULL; - Callback & dest = dests.operator[](i); - return &dest; + return &dests[i]; } - //DispatcherL0 -DispatcherL0::DispatcherL0() -{ -} - -DispatcherL0::~DispatcherL0() -{ - ASSERT(dests.IsEmpty()); -} - void DispatcherL0::DoDispatch() const { int c = 0; - const Handler *list = dests.GetNext(), *e = list; - do + const Handler *list = dests.GetPtr(), *e = list; + while((e = e->GetNext()) != list) { - ++c; - e->h(); - e = e->GetNext(); + e->h(); ++c; } - while(e != list); } - -#if 0 //for compile / debug only -template class Dispatchable; -template class Dispatcher; - -template void DispatcherGen::DoDispatch(const int & o, unsigned param) const; -template void DispatcherGen::Register(Dispatchable & d, unsigned key); -template void DispatcherGen::Unregister(Dispatchable & d, unsigned key); - -DispatcherGen gen; -DispatcherCBGen gencb; -#endif \ No newline at end of file diff --git a/bazaar/Dispatcher/Dispatcher.h b/bazaar/Dispatcher/Dispatcher.h index a7904b82f..c3b7312c8 100644 --- a/bazaar/Dispatcher/Dispatcher.h +++ b/bazaar/Dispatcher/Dispatcher.h @@ -2,36 +2,36 @@ #define _Dispatcher_Dispatcher_h #include - using namespace Upp; #include -template -class Dispatcher; +template class Dispatcher; class DispatcherGen; template -class Dispatchable - : public EnableOption<> +class Dispatchable : public EnableOption { friend class Dispatcher; friend class DispatcherGen; public: typedef Dispatchable CLASSNAME; - Dispatchable(); - virtual ~Dispatchable(); + typedef EnableOption R; + + Dispatchable() : act(true) {} + virtual ~Dispatchable() { UnregisterAll(); } public: - virtual void Dispatch(const T & o) = 0; + virtual void Dispatch(const T& o) = 0; - void Unregister(const Any & _src); - void UnregisterAll(); - void Unregister(Dispatcher & from) { int i = src.Find(GetPtrHashValue(&from)); if(i<0) return; Unregister(src[i]); } - void Unregister(DispatcherGen & from) { int i = src.Find(GetPtrHashValue(&from)); if(i<0) return; Unregister(src[i]); } + void Unregister(const Any& _src); + void UnregisterAll() { while(src.GetCount()>0) Unregister(src[0]); } - const VectorMap & GetSrc() const { return src; } + void Unregister(Dispatcher& from) { int i = src.Find(GetPtrHashValue(&from)); if(i<0) return; Unregister(src[i]); } + void Unregister(DispatcherGen& from) { int i = src.Find(GetPtrHashValue(&from)); if(i<0) return; Unregister(src[i]); } + + const VectorMap& GetSrc() const { return src; } private: bool act; @@ -46,20 +46,20 @@ class Dispatcher public: typedef Dispatcher CLASSNAME; typedef EnableOption<> R; - Dispatcher(); - virtual ~Dispatcher(); - void DoDispatch(const T & o) const; + virtual ~Dispatcher() { ASSERT(dests.IsEmpty()); } + + void DoDispatch(const T& o) const; int GetCount() const { return dests.GetCount(); } - void Register(Dispatchable & d, unsigned key = 0); - void Unregister(Dispatchable & d, unsigned key = 0); - Dispatchable * GetDispatchable(unsigned key) const; - const VectorMap * > & GetDests() const { return dests; } + void Register(Dispatchable& d, unsigned key = 0); + void Unregister(Dispatchable& d, unsigned key = 0); + Dispatchable* GetDispatchable(unsigned key) const; + const VectorMap*>& GetDests() const { return dests; } void Clear() { while(dests.GetCount()>0) dests[0].Unregister(); } private: - VectorMap * > dests; + VectorMap*> dests; }; //a generic version that accepts any Dispatchable @@ -67,24 +67,21 @@ class DispatcherGen { public: typedef DispatcherGen CLASSNAME; - DispatcherGen(); - virtual ~DispatcherGen(); template - void DoDispatch(const T & o) const; + void DoDispatch(const T& o) const; template - void Register(Dispatchable & d, unsigned key = 0); + void Register(Dispatchable& d, unsigned key = 0); template - void Unregister(Dispatchable & d, unsigned key = 0); + void Unregister(Dispatchable& d, unsigned key = 0); template - Dispatcher & GetDispatcher(); + Dispatcher& GetDispatcher(); private: - Vector dests; //now does store the different Dispatcher + Vector dests; //now does store the different Dispatcher }; - //Callback variant //spares out Dispatchable interface @@ -95,53 +92,52 @@ class DispatcherCB public: typedef DispatcherCB CLASSNAME; typedef EnableOption<> R; - DispatcherCB(); - virtual ~DispatcherCB(); - void DoDispatch(const T & o) const; + virtual ~DispatcherCB() { ASSERT(dests.IsEmpty()); } + + + void DoDispatch(const T& o) const; int GetCount() const { return dests.GetCount(); } - void Register(Callback1 d, unsigned key); + void Register(Callback1 d, unsigned key); void Unregister(unsigned key); - Callback1* GetDispatchable(unsigned key); - const VectorMap > & GetDests() const { return dests; } + Callback1* GetDispatchable(unsigned key); + const VectorMap >& GetDests() const { return dests; } void Clear() { dests.Clear(); } private: - VectorMap > dests; + VectorMap > dests; }; -//a generic version that accepts any Callback +//a generic version that accepts any Callback class DispatcherCBGen { public: typedef DispatcherCBGen CLASSNAME; - DispatcherCBGen(); - virtual ~DispatcherCBGen(); template - void DoDispatch(const T & o) const; + void DoDispatch(const T& o) const; template - void Register(Callback1 d, unsigned key); + void Register(Callback1 d, unsigned key); template void Unregister(unsigned key); template - DispatcherCB & GetDispatcherCB(); + DispatcherCB& GetDispatcherCB(); private: - Vector dests; //now does store the different DispatcherCB + Vector dests; //now does store the different DispatcherCB }; - +//void param variant class Dispatcher0 : public EnableOption<> { public: typedef Dispatcher0 CLASSNAME; typedef EnableOption<> R; - Dispatcher0(); - virtual ~Dispatcher0(); + + virtual ~Dispatcher0() { ASSERT(dests.IsEmpty()); } void DoDispatch() const; int GetCount() const { return dests.GetCount(); } @@ -149,32 +145,14 @@ public: void Register(Callback d, unsigned key); void Unregister(unsigned key); Callback* GetDispatchable(unsigned key); - const VectorMap & GetDests() const { return dests; } + const VectorMap& GetDests() const { return dests; } void Clear() { dests.Clear(); } private: VectorMap dests; }; -class DispatcherL0 - : public EnableOption<> -{ -public: - typedef DispatcherL0 CLASSNAME; - typedef EnableOption<> R; - struct Handler : public Link { Callback h; }; - - DispatcherL0(); - virtual ~DispatcherL0(); - - void DoDispatch() const; - int GetCount() const { GetLinkCount(dests); } - - void Clear() { dests.Unlink(); } - - Link dests; -}; - +//Link<> list as managed data structure for easy handling template class DispatcherL : public EnableOption<> @@ -184,11 +162,30 @@ public: typedef EnableOption<> R; struct Handler : public Link { Callback h; }; - DispatcherL(); - virtual ~DispatcherL(); + virtual ~DispatcherL() { ASSERT(dests.IsEmpty()); } void DoDispatch(const T& o) const; - int GetCount() const { GetLinkCount(dests); } + int GetCount() const { return GetLinkCount(dests); } + + void Clear() { dests.Unlink(); } + + Link dests; +}; + +//Link<> list as managed data structure for easy handling +//void param list +class DispatcherL0 + : public EnableOption<> +{ +public: + typedef DispatcherL0 CLASSNAME; + typedef EnableOption<> R; + struct Handler : public Link { Callback h; }; + + virtual ~DispatcherL0() { ASSERT(dests.IsEmpty()); } + + void DoDispatch() const; + int GetCount() const { return GetLinkCount(dests); } void Clear() { dests.Unlink(); } diff --git a/bazaar/Dispatcher/Dispatcher.hpp b/bazaar/Dispatcher/Dispatcher.hpp index 619ba1e10..f97e89e14 100644 --- a/bazaar/Dispatcher/Dispatcher.hpp +++ b/bazaar/Dispatcher/Dispatcher.hpp @@ -3,82 +3,52 @@ #include "Dispatcher.h" -template -Dispatchable::Dispatchable() - : act(true) -{ - -} +//Dispatchable template -Dispatchable::~Dispatchable() +void Dispatchable::Unregister(const Any& _src) { - UnregisterAll(); -} - -template -void Dispatchable::Unregister(const Any & _src) -{ - if(_src.Is * >()) + if(_src.Is* >()) { - Dispatcher * disp = _src.Get * >(); + Dispatcher* disp = _src.Get*>(); disp->Unregister(*this, key.Get(GetPtrHashValue(disp))); } else - if(_src.Is()) + if(_src.Is()) { - DispatcherGen * disp = _src.Get(); + DispatcherGen* disp = _src.Get(); disp->Unregister(*this, key.Get(GetPtrHashValue(disp))); } } -template -void Dispatchable::UnregisterAll() -{ - while(src.GetCount()>0) - { - Unregister(src[0]); - } -} +//Dispatcher template -Dispatcher::Dispatcher() -{ - -} - -template -Dispatcher::~Dispatcher() -{ - ASSERT(dests.IsEmpty()); -} - -template -void Dispatcher::DoDispatch(const T & o) const +void Dispatcher::DoDispatch(const T& o) const { if(!R::IsEnabled()) return; for(int i = 0; i < dests.GetCount(); i++) { - Dispatchable * dest = dests.operator[](i); + Dispatchable* dest = dests[i]; if(dest->IsEnabled()) dest->Dispatch(o); } } template -void Dispatcher::Register(Dispatchable & d, unsigned key) +void Dispatcher::Register(Dispatchable& d, unsigned key) { if(key == 0) key = GetPtrHashValue(&d); int i = dests.Find(key); if(i>=0) return; dests.Add(key) = &d; - Any & a = d.src.Add(GetPtrHashValue(this)); - a.Create * >() = this; + Any& a = d.src.Add(GetPtrHashValue(this)); + a.Create*>() = this; d.key.Add(GetPtrHashValue(this)) = key; } template -void Dispatcher::Unregister(Dispatchable & d, unsigned key) +void Dispatcher::Unregister(Dispatchable& d, unsigned key) { if(key == 0) key = GetPtrHashValue(&d); int i = dests.Find(key); @@ -89,35 +59,36 @@ void Dispatcher::Unregister(Dispatchable & d, unsigned key) } template -Dispatchable * Dispatcher::GetDispatchable(unsigned key) const +Dispatchable* Dispatcher::GetDispatchable(unsigned key) const { int i = dests.Find(key); if(i<0) return NULL; - Dispatchable * dest = dests.operator[](i); - return dest; + return &dests[i]; } +//DispatcherGen + template -void DispatcherGen::DoDispatch(const T & o) const +void DispatcherGen::DoDispatch(const T& o) const { for(int i = 0; i < dests.GetCount(); i++) { - const Any & a = dests.operator[](i); + const Any& a = dests[i]; if(!a.Is >()) continue; - const Dispatcher & dest = a.Get >(); + const Dispatcher& dest = a.Get >(); dest.DoDispatch(o); return; } } template -void DispatcherGen::Register(Dispatchable & d, unsigned key) +void DispatcherGen::Register(Dispatchable& d, unsigned key) { for(int i = 0; i < dests.GetCount(); i++) { - Any & a = dests.operator[](i); + Any& a = dests[i]; if(!a.Is >()) continue; - Dispatcher & dest = a.Get >(); + Dispatcher& dest = a.Get >(); dest.Register(d, key); return; } @@ -125,13 +96,13 @@ void DispatcherGen::Register(Dispatchable & d, unsigned key) } template -void DispatcherGen::Unregister(Dispatchable & d, unsigned key) +void DispatcherGen::Unregister(Dispatchable& d, unsigned key) { for(int i = 0; i < dests.GetCount(); i++) { - Any & a = dests.operator[](i); + Any& a = dests[i]; if(!a.Is >()) continue; - Dispatcher & dest = a.Get >(); + Dispatcher& dest = a.Get >(); dest.Unregister(d, key); if(dest.GetDests().GetCount()<=0) dests.Remove(i); @@ -140,45 +111,30 @@ void DispatcherGen::Unregister(Dispatchable & d, unsigned key) } template -Dispatcher & DispatcherGen::GetDispatcher() +Dispatcher& DispatcherGen::GetDispatcher() { for(int i = 0; i < dests.GetCount(); i++) { - const Any & a = dests.operator[](i); + const Any& a = dests[i]; if(!a.Is >()) continue; - Dispatcher & dest = a.Get >(); + Dispatcher& dest = a.Get >(); return dest; } return dests.Add().Create >(); } - -//Callback variant +//DispatcherCB template -DispatcherCB::DispatcherCB() -{ -} - -template -DispatcherCB::~DispatcherCB() -{ - ASSERT(dests.IsEmpty()); -} - -template -void DispatcherCB::DoDispatch(const T & o) const +void DispatcherCB::DoDispatch(const T& o) const { if(!R::IsEnabled()) return; for(int i = 0; i < dests.GetCount(); i++) - { - const Callback1 & dest = dests.operator[](i); - dest(o); - } + dests[i](o); } template -void DispatcherCB::Register(Callback1 d, unsigned key) +void DispatcherCB::Register(Callback1 d, unsigned key) { int i = dests.Find(key); if(i>=0) return; @@ -194,35 +150,36 @@ void DispatcherCB::Unregister(unsigned key) } template -Callback1* DispatcherCB::GetDispatchable(unsigned key) +Callback1* DispatcherCB::GetDispatchable(unsigned key) { int i = dests.Find(key); if(i<0) return NULL; - Callback1 & dest = dests.operator[](i); - return &dest; + return &dests[i]; } +//DispatcherCBGen + template -void DispatcherCBGen::DoDispatch(const T & o) const +void DispatcherCBGen::DoDispatch(const T& o) const { for(int i = 0; i < dests.GetCount(); i++) { - const Any & a = dests.operator[](i); + const Any& a = dests[i]; if(!a.Is >()) continue; - const DispatcherCB & dest = a.Get >(); + const DispatcherCB& dest = a.Get >(); dest.DoDispatch(o); return; } } template -void DispatcherCBGen::Register(Callback1 d, unsigned key) +void DispatcherCBGen::Register(Callback1 d, unsigned key) { for(int i = 0; i < dests.GetCount(); i++) { - Any & a = dests.operator[](i); + Any& a = dests[i]; if(!a.Is >()) continue; - DispatcherCB & dest = a.Get >(); + DispatcherCB& dest = a.Get >(); dest.Register(d, key); return; } @@ -234,9 +191,9 @@ void DispatcherCBGen::Unregister(unsigned key) { for(int i = 0; i < dests.GetCount(); i++) { - Any & a = dests.operator[](i); + Any& a = dests[i]; if(!a.Is >()) continue; - DispatcherCB & dest = a.Get >(); + DispatcherCB& dest = a.Get >(); dest.Unregister(key); if(dest.GetDests().GetCount()<=0) dests.Remove(i); @@ -245,13 +202,13 @@ void DispatcherCBGen::Unregister(unsigned key) } template -DispatcherCB & DispatcherCBGen::GetDispatcherCB() +DispatcherCB& DispatcherCBGen::GetDispatcherCB() { for(int i = 0; i < dests.GetCount(); i++) { - const Any & a = dests.operator[](i); + const Any& a = dests[i]; if(!a.Is >()) continue; - DispatcherCB & dest = a.Get >(); + DispatcherCB& dest = a.Get >(); return dest; } return dests.Add().Create >(); @@ -259,29 +216,15 @@ DispatcherCB & DispatcherCBGen::GetDispatcherCB() //DispatcherL -template -DispatcherL::DispatcherL() -{ -} - -template -DispatcherL::~DispatcherL() -{ - ASSERT(dests.IsEmpty()); -} - template void DispatcherL::DoDispatch(const T& o) const { int c = 0; - const Handler *list = dests.GetNext(), *e = list; - do + const Handler *list = dests.GetPtr(), *e = list; + while((e = e->GetNext()) != list) { - ++c; - e->h(o); - e = e->GetNext(); + e->h(o); ++c; } - while(e != list); } #endif diff --git a/bazaar/DispatcherTest/DispatcherTest.h b/bazaar/DispatcherTest/DispatcherTest.h index 7bf7bb5af..cf7fe7fb6 100644 --- a/bazaar/DispatcherTest/DispatcherTest.h +++ b/bazaar/DispatcherTest/DispatcherTest.h @@ -18,7 +18,7 @@ public: typedef MyPane CLASSNAME; MyPane(); - virtual void Dispatch(const Value & o); + virtual void Dispatch(const Value& o); }; class DispatcherTest : public WithDispatcherTestLayout diff --git a/bazaar/DispatcherTest/main.cpp b/bazaar/DispatcherTest/main.cpp index 42b7da211..89c003817 100644 --- a/bazaar/DispatcherTest/main.cpp +++ b/bazaar/DispatcherTest/main.cpp @@ -10,7 +10,7 @@ MyPane::MyPane() dl.Add(i); } -void MyPane::Dispatch(const Value & o) +void MyPane::Dispatch(const Value& o) { ei.SetData(o); //pi.SetData(o); diff --git a/bazaar/DispatcherTest2/DispatcherTest.h b/bazaar/DispatcherTest2/DispatcherTest.h index 5cda4ec50..2f917d879 100644 --- a/bazaar/DispatcherTest2/DispatcherTest.h +++ b/bazaar/DispatcherTest2/DispatcherTest.h @@ -19,8 +19,8 @@ public: typedef MyPane CLASSNAME; MyPane(); - virtual void Dispatch(const Value & o); - virtual void Dispatch(const int & o); + virtual void Dispatch(const Value& o); + virtual void Dispatch(const int& o); }; class DispatcherTest : public WithDispatcherTestLayout diff --git a/bazaar/DispatcherTest2/main.cpp b/bazaar/DispatcherTest2/main.cpp index 7b9230a75..413d7d6ca 100644 --- a/bazaar/DispatcherTest2/main.cpp +++ b/bazaar/DispatcherTest2/main.cpp @@ -10,7 +10,7 @@ MyPane::MyPane() dl.Add(i); } -void MyPane::Dispatch(const Value & o) +void MyPane::Dispatch(const Value& o) { ei.SetData(o); //pi.SetData(o); @@ -19,7 +19,7 @@ void MyPane::Dispatch(const Value & o) st.SetText(String().Cat() << o); } -void MyPane::Dispatch(const int & o) +void MyPane::Dispatch(const int& o) { ei.SetData(o); //pi.SetData(o); diff --git a/bazaar/DispatcherTest3/DispatcherTest.h b/bazaar/DispatcherTest3/DispatcherTest.h index 1675043d1..69d5958c4 100644 --- a/bazaar/DispatcherTest3/DispatcherTest.h +++ b/bazaar/DispatcherTest3/DispatcherTest.h @@ -19,7 +19,7 @@ class WithDispatch public: typedef WithDispatch CLASSNAME; - virtual void Dispatch(const T & o) + virtual void Dispatch(const T& o) { C::SetData(o); } @@ -34,7 +34,7 @@ class ProgressIndicatorWithDispatch public: typedef ProgressIndicatorWithDispatch CLASSNAME; - virtual void Dispatch(const T & o) + virtual void Dispatch(const T& o) { Set(o); } diff --git a/bazaar/DispatcherTest3/main.cpp b/bazaar/DispatcherTest3/main.cpp index f2f64a85e..fd62c3804 100644 --- a/bazaar/DispatcherTest3/main.cpp +++ b/bazaar/DispatcherTest3/main.cpp @@ -21,7 +21,7 @@ DispatcherTest::DispatcherTest() splitv1.Vert(); for(int i = 0; i < 10; i++) { - WithDispatch * pctrl = new WithDispatch(); + WithDispatch* pctrl = new WithDispatch(); ctrls.Add(pctrl); pctrl->MinMax(0, 100); disp.Register(*pctrl); @@ -31,7 +31,7 @@ DispatcherTest::DispatcherTest() splitv2.Vert(); for(int i = 0; i < 10; i++) { - ProgressIndicatorWithDispatch * pctrl = new ProgressIndicatorWithDispatch(); + ProgressIndicatorWithDispatch* pctrl = new ProgressIndicatorWithDispatch(); ctrls.Add(pctrl); pctrl->SetTotal(100); disp.Register(*pctrl); diff --git a/bazaar/DispatcherTest4/DispatcherTest.h b/bazaar/DispatcherTest4/DispatcherTest.h index 5a3a2b755..8e8301707 100644 --- a/bazaar/DispatcherTest4/DispatcherTest.h +++ b/bazaar/DispatcherTest4/DispatcherTest.h @@ -18,11 +18,11 @@ class MyEditInt public: typedef MyEditInt CLASSNAME; - virtual void Dispatch(const Value & o) + virtual void Dispatch(const Value& o) { SetData(o); } - virtual void Dispatch(const int & o) + virtual void Dispatch(const int& o) { SetData(o); } @@ -36,11 +36,11 @@ class MyProgressIndicator public: typedef MyProgressIndicator CLASSNAME; - virtual void Dispatch(const Value & o) + virtual void Dispatch(const Value& o) { Set(o); } - virtual void Dispatch(const int & o) + virtual void Dispatch(const int& o) { Set(o); } diff --git a/bazaar/DispatcherTest4/main.cpp b/bazaar/DispatcherTest4/main.cpp index 67756e41e..1ad1b0add 100644 --- a/bazaar/DispatcherTest4/main.cpp +++ b/bazaar/DispatcherTest4/main.cpp @@ -20,7 +20,7 @@ DispatcherTest::DispatcherTest() splitv1.Vert(); for(int i = 0; i < 10; i++) { - MyEditInt * pctrl = new MyEditInt(); + MyEditInt* pctrl = new MyEditInt(); ctrls.Add(pctrl); pctrl->MinMax(0, 100); disp.Register(*pctrl); @@ -35,7 +35,7 @@ DispatcherTest::DispatcherTest() splitv2.Vert(); for(int i = 0; i < 10; i++) { - MyProgressIndicator * pctrl = new MyProgressIndicator(); + MyProgressIndicator* pctrl = new MyProgressIndicator(); ctrls.Add(pctrl); pctrl->SetTotal(100); disp.Register(*pctrl); diff --git a/bazaar/DispatcherTest5/DispatcherTest.h b/bazaar/DispatcherTest5/DispatcherTest.h index efba71b65..9a8b69e2f 100644 --- a/bazaar/DispatcherTest5/DispatcherTest.h +++ b/bazaar/DispatcherTest5/DispatcherTest.h @@ -18,11 +18,11 @@ class MyEditInt public: typedef MyEditInt CLASSNAME; - virtual void Dispatch(const Value & o) + virtual void Dispatch(const Value& o) { SetData(o); } - virtual void Dispatch(const int & o) + virtual void Dispatch(const int& o) { SetData(o); } @@ -36,11 +36,11 @@ class MyProgressIndicator public: typedef MyProgressIndicator CLASSNAME; - virtual void Dispatch(const Value & o) + virtual void Dispatch(const Value& o) { Set(o); } - virtual void Dispatch(const int & o) + virtual void Dispatch(const int& o) { Set(o); } diff --git a/bazaar/DispatcherTest5/main.cpp b/bazaar/DispatcherTest5/main.cpp index 5b480f974..b47d7da07 100644 --- a/bazaar/DispatcherTest5/main.cpp +++ b/bazaar/DispatcherTest5/main.cpp @@ -20,7 +20,7 @@ DispatcherTest::DispatcherTest() splitv1.Vert(); for(int i = 0; i < 10; i++) { - MyEditInt * pctrl = new MyEditInt(); + MyEditInt* pctrl = new MyEditInt(); ctrls.Add(pctrl); pctrl->MinMax(0, 100); @@ -36,7 +36,7 @@ DispatcherTest::DispatcherTest() splitv2.Vert(); for(int i = 0; i < 10; i++) { - MyProgressIndicator * pctrl = new MyProgressIndicator(); + MyProgressIndicator* pctrl = new MyProgressIndicator(); ctrls.Add(pctrl); pctrl->SetTotal(100); disp.Register(*pctrl); diff --git a/bazaar/DispatcherTest6/DispatcherTest.h b/bazaar/DispatcherTest6/DispatcherTest.h index 4b1814e49..eaf7f410c 100644 --- a/bazaar/DispatcherTest6/DispatcherTest.h +++ b/bazaar/DispatcherTest6/DispatcherTest.h @@ -16,11 +16,11 @@ class MyEditInt public: typedef MyEditInt CLASSNAME; - virtual void DispatchV(const Value & o) + virtual void DispatchV(const Value& o) { SetData(o); } - virtual void DispatchI(const int & o) + virtual void DispatchI(const int& o) { SetData(o); } @@ -32,11 +32,11 @@ class MyProgressIndicator public: typedef MyProgressIndicator CLASSNAME; - virtual void DispatchV(const Value & o) + virtual void DispatchV(const Value& o) { Set(o); } - virtual void DispatchI(const int & o) + virtual void DispatchI(const int& o) { Set(o); } diff --git a/bazaar/DispatcherTest6/main.cpp b/bazaar/DispatcherTest6/main.cpp index 3ff2c3401..c91be6900 100644 --- a/bazaar/DispatcherTest6/main.cpp +++ b/bazaar/DispatcherTest6/main.cpp @@ -25,7 +25,7 @@ DispatcherTest::DispatcherTest() int i = 0; for(; i < 10; i++) { - MyEditInt * pctrl = new MyEditInt(); + MyEditInt* pctrl = new MyEditInt(); ctrls.Add(pctrl); pctrl->MinMax(0, 100); @@ -41,7 +41,7 @@ DispatcherTest::DispatcherTest() splitv2.Vert(); for(; i < 20; i++) { - MyProgressIndicator * pctrl = new MyProgressIndicator(); + MyProgressIndicator* pctrl = new MyProgressIndicator(); ctrls.Add(pctrl); pctrl->SetTotal(100);