Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Mueller <nexyon@gmail.com>2010-07-28 13:36:03 +0400
committerJoerg Mueller <nexyon@gmail.com>2010-07-28 13:36:03 +0400
commit7296600434c49b40215ba842af73a8b1517e12eb (patch)
treeba41a61f147073c91cf370c1f470b7c519397766 /intern/audaspace/FX/AUD_PingPongFactory.cpp
parent3e3f874a65e9c20353fdc26a20a2f5da9b41e90e (diff)
Audaspace: HUGE Refactor.
Some points of the refactor not sorted by importance: * Fixed immutability of readers and factories (there are exceptions...) * Fixed copy constructors and = operators * Removed messaging system * Removed reader types * Added const where possible * Using initalisers when possible * Avoided use of pointers when possible * Removed AUD_NEW and AUD_DELETE macros * Removed useless NULL pointer checks * Fixed exception catching * Fixed some yet unknown bugs * Lots of other stuff
Diffstat (limited to 'intern/audaspace/FX/AUD_PingPongFactory.cpp')
-rw-r--r--intern/audaspace/FX/AUD_PingPongFactory.cpp45
1 files changed, 15 insertions, 30 deletions
diff --git a/intern/audaspace/FX/AUD_PingPongFactory.cpp b/intern/audaspace/FX/AUD_PingPongFactory.cpp
index 8b72afe05e7..b3aaa9e80a4 100644
--- a/intern/audaspace/FX/AUD_PingPongFactory.cpp
+++ b/intern/audaspace/FX/AUD_PingPongFactory.cpp
@@ -28,40 +28,25 @@
#include "AUD_ReverseFactory.h"
AUD_PingPongFactory::AUD_PingPongFactory(AUD_IFactory* factory) :
- AUD_EffectFactory(factory) {}
-
-AUD_IReader* AUD_PingPongFactory::createReader()
+ AUD_EffectFactory(factory)
{
- if(m_factory == 0)
- return 0;
+}
- AUD_IReader* reader = m_factory->createReader();
+AUD_IReader* AUD_PingPongFactory::createReader() const
+{
+ AUD_IReader* reader = getReader();
+ AUD_IReader* reader2;
+ AUD_ReverseFactory factory(m_factory);
- if(reader != 0)
+ try
{
- AUD_IReader* reader2;
- AUD_ReverseFactory factory(m_factory);
-
- try
- {
- reader2 = factory.createReader();
- }
- catch(AUD_Exception)
- {
- reader2 = 0;
- }
-
- if(reader2 != 0)
- {
- reader = new AUD_DoubleReader(reader, reader2);
- AUD_NEW("reader")
- }
- else
- {
- delete reader; AUD_DELETE("reader")
- reader = 0;
- }
+ reader2 = factory.createReader();
+ }
+ catch(AUD_Exception&)
+ {
+ delete reader;
+ throw;
}
- return reader;
+ return new AUD_DoubleReader(reader, reader2);
}