ReceiveListenerSetMap.inl

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #include "ReceivedDataSample.h"
00009 #include "EntryExit.h"
00010 #include "dds/DCPS/Util.h"
00011 #include "dds/DCPS/GuidConverter.h"
00012 
00013 ACE_INLINE
00014 OpenDDS::DCPS::ReceiveListenerSetMap::ReceiveListenerSetMap()
00015 {
00016   DBG_ENTRY_LVL("ReceiveListenerSetMap","ReceiveListenerSetMap",6);
00017 }
00018 
00019 ACE_INLINE OpenDDS::DCPS::ReceiveListenerSet*
00020 OpenDDS::DCPS::ReceiveListenerSetMap::find(RepoId publisher_id) const
00021 {
00022   DBG_ENTRY_LVL("ReceiveListenerSetMap","find",6);
00023   ReceiveListenerSet_rch listener_set;
00024 
00025   if (OpenDDS::DCPS::find(map_, publisher_id, listener_set) != 0) {
00026     return 0;
00027   }
00028 
00029   return listener_set._retn();
00030 }
00031 
00032 ACE_INLINE OpenDDS::DCPS::ReceiveListenerSet*
00033 OpenDDS::DCPS::ReceiveListenerSetMap::find_or_create(RepoId publisher_id)
00034 {
00035   DBG_ENTRY_LVL("ReceiveListenerSetMap","find_or_create",6);
00036   ReceiveListenerSet_rch listener_set;
00037 
00038   if (OpenDDS::DCPS::find(map_, publisher_id, listener_set) != 0) {
00039     // It wasn't found.  Create one and insert it.
00040     listener_set = new ReceiveListenerSet();
00041 
00042     if (OpenDDS::DCPS::bind(map_, publisher_id, listener_set) != 0) {
00043       ACE_ERROR((LM_ERROR,
00044                  "(%P|%t) ERROR: Unable to insert ReceiveListenerSet into the "
00045                  "ReceiveListenerSetMap for publisher_id %C.\n",
00046                  LogGuid(publisher_id).c_str()));
00047       // Return a 'nil' ReceiveListenerSet*
00048       return 0;
00049     }
00050   }
00051 
00052   return listener_set._retn();
00053 }
00054 
00055 ACE_INLINE OpenDDS::DCPS::ReceiveListenerSet*
00056 OpenDDS::DCPS::ReceiveListenerSetMap::remove_set(RepoId publisher_id)
00057 {
00058   DBG_ENTRY_LVL("ReceiveListenerSetMap","remove_set",6);
00059   ReceiveListenerSet_rch listener_set;
00060 
00061   if (unbind(map_, publisher_id, listener_set) != 0) {
00062     VDBG((LM_DEBUG,
00063           "(%P|%t) Unable to remove ReceiveListenerSet from the "
00064           "ReceiveListenerSetMap for id %d.\n",
00065           LogGuid(publisher_id).c_str()));
00066     // Return a 'nil' ReceiveListenerSet*
00067     return 0;
00068   }
00069 
00070   return listener_set._retn();
00071 }
00072 
00073 ACE_INLINE ssize_t
00074 OpenDDS::DCPS::ReceiveListenerSetMap::size() const
00075 {
00076   DBG_ENTRY_LVL("ReceiveListenerSetMap","size",6);
00077   return map_.size();
00078 }
00079 
00080 ACE_INLINE OpenDDS::DCPS::ReceiveListenerSetMap::MapType&
00081 OpenDDS::DCPS::ReceiveListenerSetMap::map()
00082 {
00083   DBG_ENTRY_LVL("ReceiveListenerSetMap","map",6);
00084   return map_;
00085 }
00086 
00087 ACE_INLINE const OpenDDS::DCPS::ReceiveListenerSetMap::MapType&
00088 OpenDDS::DCPS::ReceiveListenerSetMap::map() const
00089 {
00090   DBG_ENTRY_LVL("ReceiveListenerSetMap","map",6);
00091   return map_;
00092 }

Generated on Fri Feb 12 20:05:25 2016 for OpenDDS by  doxygen 1.4.7