[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[certi-cvs] certi libCERTI/ObjectClass.cc libCERTI/ObjectCl...
From: |
CERTI CVS commits |
Subject: |
[certi-cvs] certi libCERTI/ObjectClass.cc libCERTI/ObjectCl... |
Date: |
Fri, 02 Sep 2011 21:42:25 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: Eric NOULARD <erk> 11/09/02 21:42:25
Modified files:
libCERTI : ObjectClass.cc ObjectClassSet.hh
Subscribable.cc Subscribable.hh
ObjectClassAttribute.cc ObjectClassAttribute.hh
ObjectClass.hh ObjectClassSet.cc
RTIG : Federation.hh FederationsList.hh
RTIG_processing.cc RTIG.cc Federation.cc
FederationsList.cc
RTIA : DeclarationManagement.cc RTIA_federate.cc
DeclarationManagement.hh
Log message:
Publishing/Unpublishing path clean-up
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.cc?cvsroot=certi&r1=3.88&r2=3.89
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.hh?cvsroot=certi&r1=3.41&r2=3.42
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Subscribable.cc?cvsroot=certi&r1=3.10&r2=3.11
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Subscribable.hh?cvsroot=certi&r1=3.9&r2=3.10
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassAttribute.cc?cvsroot=certi&r1=3.38&r2=3.39
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassAttribute.hh?cvsroot=certi&r1=3.28&r2=3.29
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.hh?cvsroot=certi&r1=3.58&r2=3.59
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.cc?cvsroot=certi&r1=3.55&r2=3.56
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.hh?cvsroot=certi&r1=3.71&r2=3.72
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.hh?cvsroot=certi&r1=3.58&r2=3.59
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG_processing.cc?cvsroot=certi&r1=3.112&r2=3.113
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG.cc?cvsroot=certi&r1=3.68&r2=3.69
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.cc?cvsroot=certi&r1=3.141&r2=3.142
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.cc?cvsroot=certi&r1=3.74&r2=3.75
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/DeclarationManagement.cc?cvsroot=certi&r1=3.35&r2=3.36
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA_federate.cc?cvsroot=certi&r1=3.118&r2=3.119
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/DeclarationManagement.hh?cvsroot=certi&r1=3.11&r2=3.12
Patches:
Index: libCERTI/ObjectClass.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.cc,v
retrieving revision 3.88
retrieving revision 3.89
diff -u -b -r3.88 -r3.89
--- libCERTI/ObjectClass.cc 1 Sep 2011 13:50:54 -0000 3.88
+++ libCERTI/ObjectClass.cc 2 Sep 2011 21:42:22 -0000 3.89
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClass.cc,v 3.88 2011/09/01 13:50:54 erk Exp $
+// $Id: ObjectClass.cc,v 3.89 2011/09/02 21:42:22 erk Exp $
// ----------------------------------------------------------------------------
#include "Object.hh"
@@ -551,7 +551,7 @@
try {
// Does federate is publishing something ? (not important)
if (isFederatePublisher(the_federate)) {
- publish(the_federate, liste_vide, 0, false);
+ publish(the_federate, liste_vide, false);
}
// Does federate subscribed something ?
@@ -587,7 +587,6 @@
void
ObjectClass::publish(FederateHandle theFederateHandle,
const std::vector <AttributeHandle> &theAttributeList,
- uint32_t theListSize,
bool PubOrUnpub)
throw (AttributeNotDefined,
RTIinternalError,
@@ -597,8 +596,10 @@
theFederateHandle);
// Do all attribute handles exist ? It may throw AttributeNotDefined.
- for (uint16_t index = 0 ; index < theListSize ; index++)
- getAttribute(theAttributeList[index]);
+ for (std::vector <AttributeHandle>::const_iterator it =
theAttributeList.begin();
+ it != theAttributeList.end(); ++it) {
+ getAttribute(*it);
+ }
// Check Security Levels
checkFederateAccess(theFederateHandle, "Publish");
@@ -607,7 +608,8 @@
D.Out(pdInit, "ObjectClass %d: Reset publish info of Federate %d.",
handle, theFederateHandle);
- for (HandleClassAttributeMap::iterator i =
_handleClassAttributeMap.begin(); i != _handleClassAttributeMap.end(); ++i) {
+ for (HandleClassAttributeMap::iterator i =
_handleClassAttributeMap.begin();
+ i != _handleClassAttributeMap.end(); ++i) {
if (i->second->isPublishing(theFederateHandle)) {
i->second->unpublish(theFederateHandle);
}
@@ -615,15 +617,18 @@
// Publish attributes one by one.
ObjectClassAttribute * attribute ;
- for (uint16_t i = 0 ; i < theListSize ; i++) {
+ for (std::vector <AttributeHandle>::const_iterator it =
theAttributeList.begin();
+ it != theAttributeList.end(); ++it) {
D.Out(pdInit, "ObjectClass %d: Federate %d publishes attribute %d.",
- handle, theFederateHandle, theAttributeList[i]);
- attribute = getAttribute(theAttributeList[i]);
- if (PubOrUnpub)
+ handle, theFederateHandle, *it);
+ attribute = getAttribute(*it);
+ if (PubOrUnpub) {
attribute->publish(theFederateHandle);
- else
+ }
+ else {
attribute->unpublish(theFederateHandle);
}
+ }
}
// ----------------------------------------------------------------------------
@@ -778,9 +783,10 @@
checkFederateAccess(fed, "Subscribe");
// Verify all attributes
- for (int i = 0 ; i < attributes.size() ; ++i) {
+ for (std::vector<AttributeHandle>::const_iterator it = attributes.begin();
+ it != attributes.end(); ++it) {
// may throw AttributeNotDefined
- getAttribute(attributes[i]);
+ getAttribute(*it);
}
if (nb_attributes > 0) {
@@ -789,15 +795,20 @@
bool was_subscriber = isSubscribed(fed);
- // FIXME what does this means?
+ /* FIXME what does this means?
+ * We first unsubscribe the federate from any attribute he may have
+ * subscribed to in order to resubscribe to the new specified set of
attribute.
+ */
unsubscribe(fed, region);
Debug(D, pdTrace) << "ObjectClass::subscribe" << " : fed " << fed << ",
class " << handle
<< ", " << nb_attributes << " attributes, region "
<< (region ? region->getHandle() : 0) << std::endl ;
- for (int i = 0 ; i < attributes.size() ; ++i) {
- getAttribute(attributes[i])->subscribe(fed, region);
+ /* This loop will be void if the federate did "unsubscribe" */
+ for (std::vector<AttributeHandle>::const_iterator it = attributes.begin();
+ it != attributes.end(); ++it) {
+ getAttribute(*it)->subscribe(fed, region);
}
return (attributes.size() > 0) && !was_subscriber ;
@@ -1579,10 +1590,12 @@
void
ObjectClass::unsubscribe(FederateHandle fed, const RTIRegion *region)
{
- Debug(D, pdTrace) << "ObjectClass::unsubscribe" << ": fed " << fed << ",
region "
- << (region ? region->getHandle() : 0) << std::endl ;
+ Debug(D, pdTrace) << "ObjectClass::unsubscribe: fed " << fed
+ << ", region "
+ << (region ? region->getHandle() : 0) << std::endl;
- for (HandleClassAttributeMap::iterator i =
_handleClassAttributeMap.begin(); i != _handleClassAttributeMap.end(); ++i) {
+ for (HandleClassAttributeMap::iterator i =
_handleClassAttributeMap.begin();
+ i != _handleClassAttributeMap.end(); ++i) {
if (i->second->isSubscribed(fed, region)) {
i->second->unsubscribe(fed, region);
}
@@ -1663,4 +1676,4 @@
} // namespace certi
-// $Id: ObjectClass.cc,v 3.88 2011/09/01 13:50:54 erk Exp $
+// $Id: ObjectClass.cc,v 3.89 2011/09/02 21:42:22 erk Exp $
Index: libCERTI/ObjectClassSet.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.hh,v
retrieving revision 3.41
retrieving revision 3.42
diff -u -b -r3.41 -r3.42
--- libCERTI/ObjectClassSet.hh 1 Sep 2011 13:50:54 -0000 3.41
+++ libCERTI/ObjectClassSet.hh 2 Sep 2011 21:42:22 -0000 3.42
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassSet.hh,v 3.41 2011/09/01 13:50:54 erk Exp $
+// $Id: ObjectClassSet.hh,v 3.42 2011/09/02 21:42:22 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_OBJECT_CLASS_SET_HH
@@ -76,11 +76,17 @@
void killFederate(FederateHandle theFederate)
throw ();
- // Object Class Management
+ /**
+ * Register specified federate as a publisher of the specified attribute
list
+ * for the specified Object Class.
+ * @param[in] theFederateHandle the handle of the publisher federate
+ * @param[in] theClassHandle the handle of the class to be published
+ * @param[in] theAttributeList the list of attribute of theClassHandle
+ * @param[in] PubOrUnpub true when publishing, false when unpublishing
+ */
void publish(FederateHandle theFederateHandle,
ObjectClassHandle theClassHandle,
const std::vector <AttributeHandle> &theAttributeList,
- uint32_t theListSize,
bool PubOrUnpub)
throw (ObjectClassNotDefined, AttributeNotDefined, RTIinternalError,
SecurityError);
@@ -190,4 +196,4 @@
#endif // _CERTI_OBJECT_CLASS_SET_HH
-// $Id: ObjectClassSet.hh,v 3.41 2011/09/01 13:50:54 erk Exp $
+// $Id: ObjectClassSet.hh,v 3.42 2011/09/02 21:42:22 erk Exp $
Index: libCERTI/Subscribable.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Subscribable.cc,v
retrieving revision 3.10
retrieving revision 3.11
diff -u -b -r3.10 -r3.11
--- libCERTI/Subscribable.cc 24 Nov 2009 16:39:20 -0000 3.10
+++ libCERTI/Subscribable.cc 2 Sep 2011 21:42:23 -0000 3.11
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Subscribable.cc,v 3.10 2009/11/24 16:39:20 erk Exp $
+// $Id: Subscribable.cc,v 3.11 2011/09/02 21:42:23 erk Exp $
// ----------------------------------------------------------------------------
@@ -170,9 +170,10 @@
checkFederateAccess(fed, "Subscribe");
subscribers.push_back(Subscriber(fed, region));
}
- else
+ else {
Debug(D, pdError) << "Inconsistency in subscribe request from federate
"
<< fed << std::endl ;
+ }
}
// ----------------------------------------------------------------------------
@@ -208,4 +209,4 @@
} // namespace certi
-// $Id: Subscribable.cc,v 3.10 2009/11/24 16:39:20 erk Exp $
+// $Id: Subscribable.cc,v 3.11 2011/09/02 21:42:23 erk Exp $
Index: libCERTI/Subscribable.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Subscribable.hh,v
retrieving revision 3.9
retrieving revision 3.10
diff -u -b -r3.9 -r3.10
--- libCERTI/Subscribable.hh 24 Nov 2009 16:39:20 -0000 3.9
+++ libCERTI/Subscribable.hh 2 Sep 2011 21:42:23 -0000 3.10
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Subscribable.hh,v 3.9 2009/11/24 16:39:20 erk Exp $
+// $Id: Subscribable.hh,v 3.10 2011/09/02 21:42:23 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_SUBSCRIBABLE_HH
@@ -86,4 +86,4 @@
#endif // CERTI_SUBSCRIBABLE_HH
-// $Id: Subscribable.hh,v 3.9 2009/11/24 16:39:20 erk Exp $
+// $Id: Subscribable.hh,v 3.10 2011/09/02 21:42:23 erk Exp $
Index: libCERTI/ObjectClassAttribute.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassAttribute.cc,v
retrieving revision 3.38
retrieving revision 3.39
diff -u -b -r3.38 -r3.39
--- libCERTI/ObjectClassAttribute.cc 20 Mar 2010 16:34:13 -0000 3.38
+++ libCERTI/ObjectClassAttribute.cc 2 Sep 2011 21:42:23 -0000 3.39
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassAttribute.cc,v 3.38 2010/03/20 16:34:13 erk Exp $
+// $Id: ObjectClassAttribute.cc,v 3.39 2011/09/02 21:42:23 erk Exp $
// ----------------------------------------------------------------------------
#include "ObjectClassAttribute.hh"
@@ -83,8 +83,9 @@
ObjectClassAttribute::deletePublisher(FederateHandle fed)
{
PublishersList_t::iterator it = publishers.find(fed);
- if (it != publishers.end())
+ if (it != publishers.end()) {
publishers.erase(it);
+ }
}
// ----------------------------------------------------------------------------
@@ -107,7 +108,7 @@
bool
ObjectClassAttribute::isPublishing(FederateHandle fed) const
{
- return publishers.find(fed) != publishers.end();
+ return (publishers.find(fed)) != publishers.end();
}
// ----------------------------------------------------------------------------
@@ -122,11 +123,12 @@
<< " to publishers list." << endl ;
publishers.insert(fed);
}
- else
+ else {
Debug(D, pdError) << "Attribute " << handle
<< ": Inconsistent publish request from Federate "
<< fed << endl ;
-}
+ }
+} /* end of publish */
// ----------------------------------------------------------------------------
//! unpublish
@@ -139,11 +141,11 @@
<< " from publishers list." << endl ;
deletePublisher(fed);
}
-
- else
+ else {
Debug(D, pdError) << "Attribute " << handle
<< ": Inconsistent publish request from Federate "
<< fed << endl ;
+ }
}
// ----------------------------------------------------------------------------
@@ -193,4 +195,4 @@
} // namespace
-// $Id: ObjectClassAttribute.cc,v 3.38 2010/03/20 16:34:13 erk Exp $
+// $Id: ObjectClassAttribute.cc,v 3.39 2011/09/02 21:42:23 erk Exp $
Index: libCERTI/ObjectClassAttribute.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassAttribute.hh,v
retrieving revision 3.28
retrieving revision 3.29
diff -u -b -r3.28 -r3.29
--- libCERTI/ObjectClassAttribute.hh 24 Nov 2009 16:39:20 -0000 3.28
+++ libCERTI/ObjectClassAttribute.hh 2 Sep 2011 21:42:23 -0000 3.29
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassAttribute.hh,v 3.28 2009/11/24 16:39:20 erk Exp $
+// $Id: ObjectClassAttribute.hh,v 3.29 2011/09/02 21:42:23 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_OBJECT_CLASS_ATTRIBUTE_HH
@@ -68,14 +68,28 @@
// Security methods
virtual void checkFederateAccess(FederateHandle the_federate, const
std::string& reason) const ;
- // Publish methods
- bool isPublishing(FederateHandle) const ;
- void publish(FederateHandle) throw (RTIinternalError, SecurityError);
+ /**
+ * Return true if specified federate is publisher of the attribute.
+ * @param[in] federate the handle of the federate
+ * @return true if the specified federate handle belongs to the set of
publishers of this attribute
+ * false otherwise
+ */
+ bool isPublishing(FederateHandle federate) const;
+ /**
+ * Add the federate to the set of publishers of this attribute.
+ * @param[in] federate the handle of the federate
+ */
+ void publish(FederateHandle federate) throw (RTIinternalError,
SecurityError);
+
+ /**
+ * Remove the federate from the set of publishers of this attribute.
+ * @param[in] federate the handle of the federate
+ */
void unpublish(FederateHandle) throw (RTIinternalError, SecurityError);
// Update attribute values
void updateBroadcastList(ObjectClassBroadcastList *ocb_list,
- const RTIRegion *region = 0);
+ const RTIRegion *region = NULL);
/**
* Getter for the attributes publisher list.
@@ -108,4 +122,4 @@
#endif // CERTI_OBJECT_CLASS_ATTRIBUTE_HH
-// $Id: ObjectClassAttribute.hh,v 3.28 2009/11/24 16:39:20 erk Exp $
+// $Id: ObjectClassAttribute.hh,v 3.29 2011/09/02 21:42:23 erk Exp $
Index: libCERTI/ObjectClass.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.hh,v
retrieving revision 3.58
retrieving revision 3.59
diff -u -b -r3.58 -r3.59
--- libCERTI/ObjectClass.hh 1 Sep 2011 13:50:54 -0000 3.58
+++ libCERTI/ObjectClass.hh 2 Sep 2011 21:42:23 -0000 3.59
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClass.hh,v 3.58 2011/09/01 13:50:54 erk Exp $
+// $Id: ObjectClass.hh,v 3.59 2011/09/02 21:42:23 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_OBJECT_CLASS_HH
@@ -140,7 +140,6 @@
// Publication and Subscription
void publish(FederateHandle theFederateHandle,
const std::vector <AttributeHandle> &theAttributeList,
- uint32_t theListSize,
bool PubOrUnpub)
throw (AttributeNotDefined, RTIinternalError, SecurityError);
@@ -365,4 +364,4 @@
#endif // _CERTI_OBJECT_CLASS_HH
-// $Id: ObjectClass.hh,v 3.58 2011/09/01 13:50:54 erk Exp $
+// $Id: ObjectClass.hh,v 3.59 2011/09/02 21:42:23 erk Exp $
Index: libCERTI/ObjectClassSet.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.cc,v
retrieving revision 3.55
retrieving revision 3.56
diff -u -b -r3.55 -r3.56
--- libCERTI/ObjectClassSet.cc 1 Sep 2011 13:50:54 -0000 3.55
+++ libCERTI/ObjectClassSet.cc 2 Sep 2011 21:42:23 -0000 3.56
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassSet.cc,v 3.55 2011/09/01 13:50:54 erk Exp $
+// $Id: ObjectClassSet.cc,v 3.56 2011/09/02 21:42:23 erk Exp $
// ----------------------------------------------------------------------------
// Project
@@ -285,12 +285,10 @@
} /* end of killFederate */
// ----------------------------------------------------------------------------
-//! publish
void
ObjectClassSet::publish(FederateHandle theFederateHandle,
ObjectClassHandle theClassHandle,
const std::vector <AttributeHandle> &theAttributeList,
- uint32_t theListSize,
bool PubOrUnpub)
throw (ObjectClassNotDefined,
AttributeNotDefined,
@@ -310,7 +308,6 @@
// It may throw AttributeNotDefined
theClass->publish(theFederateHandle,
theAttributeList,
- theListSize,
PubOrUnpub);
}
@@ -626,4 +623,4 @@
} // namespace certi
-// $Id: ObjectClassSet.cc,v 3.55 2011/09/01 13:50:54 erk Exp $
+// $Id: ObjectClassSet.cc,v 3.56 2011/09/02 21:42:23 erk Exp $
Index: RTIG/Federation.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.hh,v
retrieving revision 3.71
retrieving revision 3.72
diff -u -b -r3.71 -r3.72
--- RTIG/Federation.hh 1 Sep 2011 13:50:55 -0000 3.71
+++ RTIG/Federation.hh 2 Sep 2011 21:42:24 -0000 3.72
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: Federation.hh,v 3.71 2011/09/01 13:50:55 erk Exp $
+// $Id: Federation.hh,v 3.72 2011/09/02 21:42:24 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIG_FEDERATION_HH
@@ -270,7 +270,6 @@
void publishObject(FederateHandle theFederateHandle,
ObjectClassHandle theObjectHandle,
const std::vector <AttributeHandle> &theAttributeList,
- uint16_t theListSize,
bool PubOrUnpub)
throw (ObjectClassNotDefined,
AttributeNotDefined,
@@ -721,4 +720,4 @@
#endif // _CERTI_RTIG_FEDERATION_HH
-// $Id: Federation.hh,v 3.71 2011/09/01 13:50:55 erk Exp $
+// $Id: Federation.hh,v 3.72 2011/09/02 21:42:24 erk Exp $
Index: RTIG/FederationsList.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.hh,v
retrieving revision 3.58
retrieving revision 3.59
diff -u -b -r3.58 -r3.59
--- RTIG/FederationsList.hh 1 Sep 2011 13:50:55 -0000 3.58
+++ RTIG/FederationsList.hh 2 Sep 2011 21:42:24 -0000 3.59
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: FederationsList.hh,v 3.58 2011/09/01 13:50:55 erk Exp $
+// $Id: FederationsList.hh,v 3.59 2011/09/02 21:42:24 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIG_FEDERATIONS_LIST_HH
@@ -294,7 +294,6 @@
FederateHandle theFederateHandle,
ObjectClassHandle theObjectHandle,
const std::vector <AttributeHandle> &theAttributeList,
- uint16_t theListSize,
bool pub)
throw (ObjectClassNotDefined,
AttributeNotDefined,
@@ -698,4 +697,4 @@
#endif // _CERTI_RTIG_FEDERATIONS_LIST_HH
-// $Id: FederationsList.hh,v 3.58 2011/09/01 13:50:55 erk Exp $
+// $Id: FederationsList.hh,v 3.59 2011/09/02 21:42:24 erk Exp $
Index: RTIG/RTIG_processing.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG_processing.cc,v
retrieving revision 3.112
retrieving revision 3.113
diff -u -b -r3.112 -r3.113
--- RTIG/RTIG_processing.cc 1 Sep 2011 13:50:55 -0000 3.112
+++ RTIG/RTIG_processing.cc 2 Sep 2011 21:42:24 -0000 3.113
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: RTIG_processing.cc,v 3.112 2011/09/01 13:50:55 erk Exp $
+// $Id: RTIG_processing.cc,v 3.113 2011/09/02 21:42:24 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -722,13 +722,11 @@
req->getFederate(),
req->getObjectClass(),
req->getAttributes(),
- req->getAttributesSize(),
pub);
D.Out(pdRegister, "Federate %u of Federation %u published object class
%d.",
req->getFederate(), req->getFederation(),
req->getObjectClass());
-
if (pub) {
NM_Publish_Object_Class POC;
POC.setFederate(req->getFederate());
@@ -739,7 +737,6 @@
UOC.setFederate(req->getFederate());
UOC.setObjectClass(req->getObjectClass());
UOC.send(link,NM_msgBufSend); // send answer to RTIA
-
}
}
@@ -770,13 +767,11 @@
NM_Subscribe_Object_Class rep;
rep.setFederate(req->getFederate());
rep.setObjectClass(req->getObjectClass());
-
rep.send(link,NM_msgBufSend); // send answer to RTIA
} else {
NM_Unsubscribe_Object_Class rep;
rep.setFederate(req->getFederate());
rep.setObjectClass(req->getObjectClass());
-
rep.send(link,NM_msgBufSend); // send answer to RTIA
}
@@ -1569,4 +1564,4 @@
}} // namespace certi/rtig
-// $Id: RTIG_processing.cc,v 3.112 2011/09/01 13:50:55 erk Exp $
+// $Id: RTIG_processing.cc,v 3.113 2011/09/02 21:42:24 erk Exp $
Index: RTIG/RTIG.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG.cc,v
retrieving revision 3.68
retrieving revision 3.69
diff -u -b -r3.68 -r3.69
--- RTIG/RTIG.cc 25 Mar 2011 20:53:53 -0000 3.68
+++ RTIG/RTIG.cc 2 Sep 2011 21:42:24 -0000 3.69
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: RTIG.cc,v 3.68 2011/03/25 20:53:53 erk Exp $
+// $Id: RTIG.cc,v 3.69 2011/09/02 21:42:24 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -230,6 +230,7 @@
case NetworkMessage::UNPUBLISH_OBJECT_CLASS:
D.Out(pdTrace, "un/publishObjectClass.");
auditServer.setLevel(7);
+ /* we cast to Publish because Unpublish inherits from Publish */
processPublishObjectClass(link,
static_cast<NM_Publish_Object_Class*>(msg));
break ;
@@ -1054,4 +1055,4 @@
}} // namespace certi/rtig
-// $Id: RTIG.cc,v 3.68 2011/03/25 20:53:53 erk Exp $
+// $Id: RTIG.cc,v 3.69 2011/09/02 21:42:24 erk Exp $
Index: RTIG/Federation.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.cc,v
retrieving revision 3.141
retrieving revision 3.142
diff -u -b -r3.141 -r3.142
--- RTIG/Federation.cc 1 Sep 2011 13:50:55 -0000 3.141
+++ RTIG/Federation.cc 2 Sep 2011 21:42:24 -0000 3.142
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: Federation.cc,v 3.141 2011/09/01 13:50:55 erk Exp $
+// $Id: Federation.cc,v 3.142 2011/09/02 21:42:24 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -1608,7 +1608,6 @@
Federation::publishObject(FederateHandle federate,
ObjectClassHandle object,
const std::vector <AttributeHandle> &attributes,
- uint16_t list_size,
bool pub)
throw (ObjectClassNotDefined,
AttributeNotDefined,
@@ -1616,20 +1615,19 @@
SaveInProgress,
SecurityError,
RestoreInProgress,
- RTIinternalError)
- {
+ RTIinternalError) {
G.Out(pdGendoc,"enter Federation::publishObject");
// It may throw FederateNotExecutionMember.
this->check(federate);
- // It may throw *NotDefined
- root->ObjectClasses->publish(federate, object, attributes, list_size,
pub);
+ // It may throw *NotDefined*
+ root->ObjectClasses->publish(federate, object, attributes, pub);
D.Out(pdRegister,
"Federation %d: Federate %d(un)publishes %d attrib. of
ObjClass %d.",
- handle, federate, list_size, object);
+ handle, federate, attributes.size(), object);
G.Out(pdGendoc,"exit Federation::publishObject");
- }
+}
void
@@ -1898,7 +1896,7 @@
* (subscribeObject).
*/
- // It may throw NotDefined
+ // It may throw AttributeNotDefined
root->ObjectClasses->subscribe(federate, object, attributes);
/*
@@ -1946,12 +1944,10 @@
// notify all publishers
std::set<FederateHandle> federate_set;
-
for (ObjectClassAttribute::PublishersList_t::const_iterator
k=publishers.begin();
k!=publishers.end();
k++) {
-
if (getFederate(*k).isClassRelevanceAdvisorySwitch()) {
federate_set.insert(*k);
}
@@ -1973,7 +1969,7 @@
federate_vector.clear();
}
else { // unsubscribe branch
- /* test if objectclass is subscribed by anyone else
+ /* test if objectClass is subscribed by anyone else
* -> yes : do nothing
* -> no : test if publisher sets its CRA switch
* -> no : do nothing
@@ -2749,5 +2745,5 @@
}} // namespace certi/rtig
-// $Id: Federation.cc,v 3.141 2011/09/01 13:50:55 erk Exp $
+// $Id: Federation.cc,v 3.142 2011/09/02 21:42:24 erk Exp $
Index: RTIG/FederationsList.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.cc,v
retrieving revision 3.74
retrieving revision 3.75
diff -u -b -r3.74 -r3.75
--- RTIG/FederationsList.cc 1 Sep 2011 13:50:55 -0000 3.74
+++ RTIG/FederationsList.cc 2 Sep 2011 21:42:24 -0000 3.75
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: FederationsList.cc,v 3.74 2011/09/01 13:50:55 erk Exp $
+// $Id: FederationsList.cc,v 3.75 2011/09/02 21:42:24 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -742,7 +742,6 @@
FederateHandle federate,
ObjectClassHandle object_class,
const std::vector <AttributeHandle> &attributes,
- uint16_t list_size,
bool pub)
throw (ObjectClassNotDefined,
AttributeNotDefined,
@@ -757,8 +756,7 @@
// It may throw FederationExecutionDoesNotExist.
Federation *federation = searchFederation(federationHandle);
- federation->publishObject(federate, object_class, attributes, list_size,
- pub);
+ federation->publishObject(federate, object_class, attributes, pub);
}
// ----------------------------------------------------------------------------
@@ -1448,5 +1446,5 @@
}} // certi::rtig
-// EOF $Id: FederationsList.cc,v 3.74 2011/09/01 13:50:55 erk Exp $
+// EOF $Id: FederationsList.cc,v 3.75 2011/09/02 21:42:24 erk Exp $
Index: RTIA/DeclarationManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/DeclarationManagement.cc,v
retrieving revision 3.35
retrieving revision 3.36
diff -u -b -r3.35 -r3.36
--- RTIA/DeclarationManagement.cc 1 Sep 2011 13:50:55 -0000 3.35
+++ RTIA/DeclarationManagement.cc 2 Sep 2011 21:42:24 -0000 3.36
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: DeclarationManagement.cc,v 3.35 2011/09/01 13:50:55 erk Exp $
+// $Id: DeclarationManagement.cc,v 3.36 2011/09/02 21:42:24 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -59,19 +59,16 @@
void
DeclarationManagement::publishObjectClass(ObjectClassHandle theClassHandle,
const std::vector <AttributeHandle>
&attribArray,
- uint32_t attribArraySize,
TypeException &e)
{
G.Out(pdGendoc,"enter DeclarationManagement::publishObjectClass") ;
e = e_NO_EXCEPTION ;
- // Partie Locale
-
+ // Local update
try {
rootObject->ObjectClasses->publish(fm->federate,
theClassHandle,
attribArray,
- attribArraySize,
true);
}
catch (Exception *e) {
@@ -80,20 +77,20 @@
throw e ;
}
- // Partie RTIG
+ // RTIG update
NM_Publish_Object_Class req ;
req.setObjectClass(theClassHandle);
- req.setAttributesSize(attribArraySize);
+ req.setAttributesSize(attribArray.size());
req.setFederation(fm->_numero_federation);
req.setFederate(fm->federate);
- for (uint32_t i=0 ; i<attribArraySize ; i++)
+ for (uint32_t i=0 ; i<attribArray.size() ; i++)
req.setAttributes(attribArray[i],i) ;
- // Emission
+ // Send to RTIG
comm->sendMessage(&req);
- // Reception
+ // Receive RTIG answer
std::auto_ptr<NetworkMessage>
rep(comm->waitMessage(NetworkMessage::PUBLISH_OBJECT_CLASS, req.getFederate()));
e = rep->getException() ;
@@ -106,38 +103,33 @@
DeclarationManagement::unpublishObjectClass(ObjectClassHandle theClassHandle,
TypeException &e)
{
- // Variables leurres
- //AttributeHandle *attribArray = NULL ;
- uint16_t attribArraySize = 0 ;
- std::vector <AttributeHandle> attribArrayVector ;
- attribArrayVector.empty();
+ // Dummy var containing no Attribute at all
+ std::vector <AttributeHandle> attribArrayVector;
e = e_NO_EXCEPTION ;
- // Partie Locale
-
+ // Local update
try {
rootObject->ObjectClasses->publish(fm->federate,
theClassHandle,
attribArrayVector,
- attribArraySize,
false);
} catch (Exception *e) {
D.Out(pdExcept, "Exception catched in UnpublishObjectClass.");
throw e ;
}
- // Partie RTIG
+ // RTIG update
NM_Unpublish_Object_Class req ;
req.setFederation(fm->_numero_federation) ;
req.setFederate(fm->federate);
req.setObjectClass(theClassHandle);
- // Emission de la requete vers le RTIG
+ // Send request to RTIG
comm->sendMessage(&req);
- // On attend une reponse
+ // Receive RTIG answer
std::auto_ptr<NetworkMessage>
rep(comm->waitMessage(NetworkMessage::UNPUBLISH_OBJECT_CLASS,
req.getFederate()));
e = rep->getException() ;
@@ -482,4 +474,4 @@
}} // namespace certi/rtia
-// $Id: DeclarationManagement.cc,v 3.35 2011/09/01 13:50:55 erk Exp $
+// $Id: DeclarationManagement.cc,v 3.36 2011/09/02 21:42:24 erk Exp $
Index: RTIA/RTIA_federate.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_federate.cc,v
retrieving revision 3.118
retrieving revision 3.119
diff -u -b -r3.118 -r3.119
--- RTIA/RTIA_federate.cc 1 Sep 2011 13:50:55 -0000 3.118
+++ RTIA/RTIA_federate.cc 2 Sep 2011 21:42:24 -0000 3.119
@@ -306,10 +306,7 @@
D.Out(pdTrace,
"Receiving Message from Federate, type
PublishObjectClass.");
- dm->publishObjectClass(POCq->getObjectClass(),
- POCq->getAttributes(),
- POCq->getAttributesSize(),
- e);
+
dm->publishObjectClass(POCq->getObjectClass(),POCq->getAttributes(),e);
}
break ;
@@ -318,7 +315,6 @@
UOCq = static_cast<M_Unpublish_Object_Class *>(req);
D.Out(pdTrace,
"Receiving Message from Federate, type
UnpublishObjectClass.");
-
dm->unpublishObjectClass(UOCq->getObjectClass(), e);
}
break ;
Index: RTIA/DeclarationManagement.hh
===================================================================
RCS file: /sources/certi/certi/RTIA/DeclarationManagement.hh,v
retrieving revision 3.11
retrieving revision 3.12
diff -u -b -r3.11 -r3.12
--- RTIA/DeclarationManagement.hh 27 Feb 2010 16:53:36 -0000 3.11
+++ RTIA/DeclarationManagement.hh 2 Sep 2011 21:42:25 -0000 3.12
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: DeclarationManagement.hh,v 3.11 2010/02/27 16:53:36 erk Exp $
+// $Id: DeclarationManagement.hh,v 3.12 2011/09/02 21:42:25 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIA_DM
@@ -48,7 +48,6 @@
void publishObjectClass(ObjectClassHandle theClassHandle,
const std::vector <AttributeHandle> &attribArray,
- uint32_t attribArraySize,
TypeException &e);
void unpublishObjectClass(ObjectClassHandle theClassHandle,
@@ -127,4 +126,4 @@
#endif // _CERTI_RTIA_DM
-// $Id: DeclarationManagement.hh,v 3.11 2010/02/27 16:53:36 erk Exp $
+// $Id: DeclarationManagement.hh,v 3.12 2011/09/02 21:42:25 erk Exp $
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [certi-cvs] certi libCERTI/ObjectClass.cc libCERTI/ObjectCl...,
CERTI CVS commits <=