summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DAnCE/Config_Handlers/SPK_Handler.cpp
blob: e773125299481703ba2f4befaf26164e3aaa5db6 (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
//$Id$

#include "SPK_Handler.h"
#include "tao/Exception.h"
#include "Utils.h"

using CIAO::Config_Handler::Utils;

void
CIAO::Config_Handler::SPK_Handler::
process_SatisfierPropertyKind (DOMNodeIterator * iter,
                               Deployment::SatisfierPropertyKind &kind)
{
  // -- SatisfierPropertyKind enum
  XStr quantity  ("Quantity");
  XStr capacity  ("Capacity");
  XStr minimum   ("Minimum");
  XStr maximum   ("Maximum");
  XStr attribute ("Attribute");
  XStr selection ("Selection");

  XStr kind_str = XStr (Utils::parse_string (iter));
  if (kind_str == quantity)
     kind = Deployment::Quantity;
  else if (kind_str = capacity)
     kind = Deployment::Capacity;
  else if (kind_str == minimum)
     kind = Deployment::Minimum;
  else if (kind_str == maximum)
     kind = Deployment::Maximum;
  else if (kind_str == attribute)
     kind = Deployment::Attribute;
  else if (kind_str == selection)
     kind = Deployment::Selection;

  // Something wrong here.. Throw exception
  ACE_DEBUG ((LM_DEBUG,
              "Config_Handler::SPK_Handler::process_SPK \
               illegal <SatisfierPropertyKind> value found \n"));
  ACE_THROW (CORBA::INTERNAL ());
}