summaryrefslogtreecommitdiff
path: root/ACE/examples/APG/Streams/RecordingDeviceFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/examples/APG/Streams/RecordingDeviceFactory.cpp')
-rw-r--r--ACE/examples/APG/Streams/RecordingDeviceFactory.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/ACE/examples/APG/Streams/RecordingDeviceFactory.cpp b/ACE/examples/APG/Streams/RecordingDeviceFactory.cpp
new file mode 100644
index 00000000000..f5585e1ec0a
--- /dev/null
+++ b/ACE/examples/APG/Streams/RecordingDeviceFactory.cpp
@@ -0,0 +1,25 @@
+// $Id$
+
+#include "RecordingDevice.h"
+#include "RecordingDeviceFactory.h"
+#include "RecordingDevice_Text.h"
+
+RecordingDevice *RecordingDeviceFactory::instantiate (int argc,
+ ACE_TCHAR *argv[])
+{
+ RecordingDevice * device = 0;
+
+ // Determine the implementation based on the values of argv
+ // Exclude 2
+ device = new TextListenerAcceptor ();
+ // Exclude 2
+
+ // Initialize the device with the remaining parameters.
+ if (device->init (argc, argv) < 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("RecordingDeviceFactory::instantiate() - ")
+ ACE_TEXT ("%s->init(argc, argv)"),
+ device->get_name()),
+ 0);
+ return device;
+}