blob: 88808bb4a6f8806a7c0f743cfbbf88bba9b5b21b (
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
|
// $Id$
#ifndef IDREF_BASE_CPP
#define IDREF_BASE_CPP
#include "IDREF_Base.h"
#include <iostream>
ACE_RCSID (DAnCE,
IDREF_Base,
"$Id$")
namespace CIAO
{
namespace Config_Handlers
{
template <typename T>
void
IDREF_Base<T>::bind_ref (ACE_CString& id, T value)
throw (Config_Error)
{
int retval =
idref_map_.bind (id, value);
pos_map_.bind (value,id);
if (retval < 0)
throw Config_Error (id.c_str (),
"Failed to bind an IDRef. This likely indicates a name clash.");
}
template <typename T>
void
IDREF_Base<T>::find_ref (const ACE_CString& id, T& val)
throw (Config_Error)
{
int retval =
idref_map_.find (id, val);
if (retval < 0)
throw Config_Error (id.c_str (),
"Unable to look up an IDRef.");
}
template <typename T>
void
IDREF_Base<T>::find_ref (const T& value, ACE_CString& id)
throw (Config_Error)
{
int retval =
pos_map_.find (value, id);
if (retval < 0)
throw Config_Error ("No location information",
"Failed a reverse IDRef lookup.");
}
template <typename T>
bool
IDREF_Base<T>::unbind_refs (void)
{
int retval =
idref_map_.unbind_all ();
pos_map_.unbind_all ();
if (retval < 0)
return false;
return true;
}
}
}
#endif /* IDREF_BASE_CPP */
|