summaryrefslogtreecommitdiff
path: root/DAnCE/tools/Config_Handlers/Utils/Functors.h
diff options
context:
space:
mode:
Diffstat (limited to 'DAnCE/tools/Config_Handlers/Utils/Functors.h')
-rw-r--r--DAnCE/tools/Config_Handlers/Utils/Functors.h83
1 files changed, 0 insertions, 83 deletions
diff --git a/DAnCE/tools/Config_Handlers/Utils/Functors.h b/DAnCE/tools/Config_Handlers/Utils/Functors.h
deleted file mode 100644
index f7365c30e75..00000000000
--- a/DAnCE/tools/Config_Handlers/Utils/Functors.h
+++ /dev/null
@@ -1,83 +0,0 @@
-#ifndef CONFIG_HANDLERS_FUNCTORS_H
-#define CONFIG_HANDLERS_FUNCTORS_H
-
-/**
- * @file Functors.h
- * @author William Otte <wotte@dre.vanderbilt.edu>
- *
- * Functors useful in the config handlers
- */
-#include <iterator>
-
-#include "tao/Basic_Types.h" // For CORBA::ULong
-#include "tao/StringSeqC.h"
-
-#include "ace/XML_Utils/XMLSchema/Types.hpp"
-namespace DAnCE
-{
- namespace Config_Handlers
- {
- template <typename Source,
- typename Dest,
- typename Dest_Type,
- void (&Func)(const Source &, Dest_Type &)>
- struct Sequence_Handler
- {
- Sequence_Handler (Dest &dest, CORBA::ULong pos = 0)
- : dest_ (dest),
- pos_ (pos)
- {
- }
-
- void operator() (const ACE_Refcounted_Auto_Ptr <Source, ACE_Null_Mutex> &src)
- {
- Func (*src, dest_[pos_++]);
- }
-
- private:
- Dest &dest_;
- CORBA::ULong pos_;
- };
-
- /*
- * This is a workaround for a GCC bug that for some reason causes
- * functions that appear ONLY in a Sequence_Handler typedef to not
- * be present in the compiled object file.
- * This bug was first observed in GCC 4.02.
- *
- * W: The function we want to be defined
- * X: First argument to the function
- * Y: Second argument to the function
- */
-#define SEQ_HAND_GCC_BUG_WORKAROUND(W, X, Y) \
- while(0) { \
- W (*X, Y[0]); \
- }
-
-
- template <typename Dest, typename Dest_Type>
- struct String_Seq_Handler
- {
- String_Seq_Handler (Dest &dest, CORBA::ULong pos = 0)
- : dest_ (dest),
- pos_ (pos)
- {
- }
-
- void operator() (const ACE_Refcounted_Auto_Ptr < ::XMLSchema::string<ACE_TCHAR>, ACE_Null_Mutex> &src)
- {
- dest_[pos_++] = ACE_TEXT_ALWAYS_CHAR (src->c_str ());
- }
-
- private:
- Dest &dest_;
- CORBA::ULong pos_;
- };
-
- typedef String_Seq_Handler < ::CORBA::StringSeq,
- ::CORBA::String_var > String_Seq_Functor;
-
- }
-}
-
-#endif /* CONFIG_HANDLERS_FUNCTORS_H */