summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.cpp')
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.cpp b/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.cpp
new file mode 100644
index 00000000000..3645ca79367
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/ArgPair.cpp
@@ -0,0 +1,39 @@
+#include <algorithm>
+
+#include "ArgPair.h"
+
+ArgPair::ArgPair (int c, char **v)
+ : argc (c),
+ argv (new char *[c])
+{
+ std::copy (v, v + c, this->argv);
+}
+
+ArgPair::ArgPair (const ArgPair &ap)
+ : argc (ap.argc),
+ argv (new char *[ap.argc])
+{
+ std::copy (ap.argv, ap.argv + ap.argc, this->argv);
+}
+
+ArgPair & ArgPair::operator = (const ArgPair &ap)
+{
+ if (this != &ap)
+ {
+ ArgPair temp (ap);
+ this->swap (temp);
+ }
+ return *this;
+}
+
+void ArgPair::swap (ArgPair &ap)
+{
+ std::swap (this->argc, ap.argc);
+ std::swap (this->argv, ap.argv);
+}
+
+ArgPair::~ArgPair()
+{
+ delete [] argv;
+}
+