summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/IFRService/IFR_Service_Utils_T.h
blob: 4c00273e01e9842e272e7d9dec6576a9bb6307b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// -*- C++ -*-

//=============================================================================
/**
 *  @file    IFR_Service_Utils_T.h
 *
 *  Template methods useful to IFR Service.
 *
 *  @author Jeff Parsons <j.parsons@vanderbilt.edu>
 */
//=============================================================================


#ifndef TAO_IFR_SERVICE_UTILS_T_H
#define TAO_IFR_SERVICE_UTILS_T_H

#include /**/ "ace/pre.h"

#include "ace/Configuration.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "tao/IFR_Client/IFR_ComponentsC.h"

#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#endif /* _MSC_VER */

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

class TAO_Repository_i;

template<typename T>
class TAO_IFR_Generic_Utils
{
public:
  static void destroy_special (const ACE_TCHAR *section_name,
                               TAO_Repository_i *repo,
                               ACE_Configuration_Section_Key &key);

  static void set_initializers (const T &initializers,
                                ACE_Configuration *config,
                                ACE_Configuration_Section_Key &key);
  /// Common to Container::create_value(), create_ext_value
  /// and ValueDef::initializers().
};

template<typename T_desc, typename T_impl>
class TAO_IFR_Desc_Utils
{
public:
  static void fill_desc_begin (T_desc &desc,
                               TAO_Repository_i *repo,
                               ACE_Configuration_Section_Key &key);
};

template<typename T_strseq>
class TAO_IFR_Strseq_Utils
{
public:
  static void fill_string_seq (const char *section_name,
                               ACE_Configuration *config,
                               ACE_Configuration_Section_Key &key,
                               T_strseq &seq);
};

template <typename T_desc_seq>
class TAO_Port_Desc_Seq_Utils
{
public:
  static void port_descriptions (T_desc_seq &desc_seq,
                                 ACE_Configuration *config,
                                 ACE_Configuration_Section_Key &key,
                                 const char *sub_section);

  static void get_is_multiple (T_desc_seq &desc_seq,
                               ACE_Configuration *config,
                               ACE_Configuration_Section_Key &key,
                               CORBA::ULong index);

  static void port_base_type (T_desc_seq &desc_seq,
                              ACE_TString &holder,
                              CORBA::ULong index);
};

template<typename T>
class TAO_Port_Utils
{
public:
  static T *create_entry (const char *id,
                          const char *name,
                          const char *version,
                          const char *sub_section,
                          CORBA::Container_ptr port_base_type,
                          CORBA::Boolean is_multiple,
                          TAO_Repository_i *repo,
                          CORBA::DefinitionKind port_kind,
                          ACE_Configuration_Section_Key &key);

  static void set_is_multiple (CORBA::Boolean is_multiple,
                               ACE_Configuration *config,
                               ACE_Configuration_Section_Key &key);
};

TAO_END_VERSIONED_NAMESPACE_DECL

#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
#include "orbsvcs/IFRService/IFR_Service_Utils_T.cpp"
#endif /* defined REQUIRED SOURCE */

#if defined(_MSC_VER)
#pragma warning(pop)
#endif /* _MSC_VER */

#include /**/ "ace/post.h"

#endif /* TAO_IFR_SERVICE_UTILS_T_H */