OpenDDS  Snapshot(2023/04/28-20:55)
Public Member Functions | Private Types | Private Attributes | List of all members
OpenDDS::ICE::ActiveFoundationSet Class Reference

#include <Checklist.h>

Collaboration diagram for OpenDDS::ICE::ActiveFoundationSet:
Collaboration graph
[legend]

Public Member Functions

void add (const FoundationType &a_foundation)
 
bool remove (const FoundationType &a_foundation)
 
bool contains (const FoundationType &a_foundation) const
 
bool operator== (const ActiveFoundationSet &a_other) const
 

Private Types

typedef std::map< FoundationType, size_t > FoundationsType
 

Private Attributes

FoundationsType foundations_
 

Detailed Description

Definition at line 36 of file Checklist.h.

Member Typedef Documentation

◆ FoundationsType

Definition at line 69 of file Checklist.h.

Member Function Documentation

◆ add()

void OpenDDS::ICE::ActiveFoundationSet::add ( const FoundationType a_foundation)
inline

Definition at line 38 of file Checklist.h.

References foundations_.

Referenced by OpenDDS::ICE::AgentImpl::add(), and OpenDDS::ICE::Checklist::compute_active_foundations().

39  {
40  std::pair<FoundationsType::iterator, bool> x = foundations_.insert(std::make_pair(a_foundation, 0));
41  ++x.first->second;
42  }

◆ contains()

bool OpenDDS::ICE::ActiveFoundationSet::contains ( const FoundationType a_foundation) const
inline

Definition at line 58 of file Checklist.h.

References foundations_.

Referenced by OpenDDS::ICE::AgentImpl::contains().

59  {
60  return foundations_.find(a_foundation) != foundations_.end();
61  }

◆ operator==()

bool OpenDDS::ICE::ActiveFoundationSet::operator== ( const ActiveFoundationSet a_other) const
inline

Definition at line 63 of file Checklist.h.

References foundations_.

64  {
65  return foundations_ == a_other.foundations_;
66  }

◆ remove()

bool OpenDDS::ICE::ActiveFoundationSet::remove ( const FoundationType a_foundation)
inline

Definition at line 44 of file Checklist.h.

References foundations_, and OPENDDS_ASSERT.

Referenced by OpenDDS::ICE::AgentImpl::remove().

45  {
46  FoundationsType::iterator pos = foundations_.find(a_foundation);
47  OPENDDS_ASSERT(pos != foundations_.end());
48  --pos->second;
49 
50  if (pos->second == 0) {
51  foundations_.erase(pos);
52  return true;
53  }
54 
55  return false;
56  }
#define OPENDDS_ASSERT(C)
Definition: Definitions.h:72

Member Data Documentation

◆ foundations_

FoundationsType OpenDDS::ICE::ActiveFoundationSet::foundations_
private

Definition at line 70 of file Checklist.h.

Referenced by add(), contains(), operator==(), and remove().


The documentation for this class was generated from the following file: