summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Trader/Property_Filter.h
blob: 5777de4ab8b29d8b59bd4aa0f2e99ebcd50e6401 (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
/* -*- C++ -*- */

// ========================================================================
// $Id$
// 
// = LIBRARY 
//    orbsvcs
//  
// = FILENAME 
//    Property_Filter.h
// 
// = AUTHOR 
//    Seth Widoff <sbw1@cs.wustl.edu>
// 
// ======================================================================= 

#ifndef TAO_PROPERTY_FILTER_H
#define TAO_PROPERTY_FILTER_H

#include <set>
#include <deque>

#if defined (OS_NO_NAMESPACE)
#define map yadda
#endif /* OS_NO_NAMESPACE */

#include "ace/OS.h"
#include "CosTradingC.h"
#include "Trader_Base.h"

#if defined (OS_NO_NAMESPACE)
#undef map
#endif /* OS_NO_NAMESPACE */

class TAO_Property_Filter
// = TITLE
//
//   The Ace_Property_Filter copies those properties specified in a
//   CosTrading::Lookup::SpecifiedProps from a source
//   CosTrading::Offer to a destination CosTrading::Offer. 
{
public:

  typedef CosTrading::Lookup::SpecifiedProps SPECIFIED_PROPS;
  
  TAO_Property_Filter (const SPECIFIED_PROPS& desired_props,
		       CORBA::Environment& env)
    TAO_THROW_SPEC (CosTrading::IllegalPropertyName,
		    CosTrading::DuplicatePropertyName);
  // Verify that the specified properties are correct.

  TAO_Property_Filter (const TAO_Property_Filter& prop_filter);

  void filter_offer (const CosTrading::Offer& source,
		     CosTrading::Offer& destination);
  // Copy the desired properties from the source offer to the
  // destination offer.
  
private:

  typedef set< string,  less <string> > PROP_NAMES;
  typedef deque< CosTrading::Property* > PROP_QUEUE;
  
  int verify_property_name (const char* name);

  PROP_NAMES props_;
  CosTrading::Lookup::HowManyProps policy_;
};

#endif /* TAO_PROPERTY_FILTER_H */