summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.inl
blob: 81731c09f05c8408b7ad173b09853f0558aa4e1f (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
// -*- C++ -*-
//
// $Id$

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

ACE_INLINE
TAO_AV_QoS &
TAO_Base_StreamEndPoint::qos (void)
{
  return this->qos_;
}

ACE_INLINE
int
TAO_AV_QoS::set (AVStreams::streamQoS &stream_qos)
{
  this->stream_qos_ = stream_qos;

  for (u_int j=0;j<this->stream_qos_.length ();j++)
    {
      ACE_CString qos_key (CORBA::string_dup (this->stream_qos_[j].QoSType));
      int result = this->qos_map_.bind (qos_key,this->stream_qos_[j]);
      if (result < 0)
        ACE_ERROR_RETURN ((LM_ERROR,
			   "(%N,%l) TAO_AV_QoS::set qos_map::bind failed\n"),-1);
    }
  return 0;
}


ACE_INLINE
int
TAO_AV_QoS::get_flow_qos (const char *flowname,
			  AVStreams::QoS &flow_qos)
{
  int result = this->qos_map_.find (flowname, 
				    flow_qos);

  if (result < 0)
    {
      if (TAO_debug_level > 0 ) {
        ACE_DEBUG((LM_DEBUG, "(%N,%l) qos_map contains the flows:\n"));

        ACE_Hash_Map_Manager<ACE_CString,AVStreams::QoS,ACE_Null_Mutex>::ITERATOR iter
          = qos_map_.begin();

        while( iter != qos_map_.end() )
        {
          ACE_DEBUG((LM_DEBUG, "  %s\n", (*iter).ext_id_.c_str() ));
          ++iter; 
        }
      
        ACE_DEBUG ((LM_DEBUG,
                    "(%N,%l) TAO_AV_QOS::get_flow_qos qos_map::find failed for %s\n", flowname));
      }
      return -1;
    }
  return 0;
}

TAO_END_VERSIONED_NAMESPACE_DECL