[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[certi-cvs] certi RTIG/FederationsList.cc RTIG/Federate.cc ...
From: |
certi-cvs |
Subject: |
[certi-cvs] certi RTIG/FederationsList.cc RTIG/Federate.cc ... |
Date: |
Thu, 19 Nov 2009 18:15:33 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: Eric NOULARD <erk> 09/11/19 18:15:32
Modified files:
RTIG : FederationsList.cc Federate.cc Federate.hh
FederationsList.hh Federation.hh Federation.cc
RTIG_processing.cc RTIG.cc
RTIA : Statistics.cc OwnershipManagement.hh
FederationManagement.hh ObjectManagement.cc
RTIA_federate.cc DataDistribution.cc
TimeManagement.cc ObjectManagement.hh
FederationManagement.cc DataDistribution.hh
OwnershipManagement.cc
libCERTI : RoutingSpace.cc ObjectClassAttribute.hh
SecurityServer.cc Interaction.cc
ObjectAttribute.hh InteractionSet.hh
ObjectClass.cc Interaction.hh NetworkMessage.cc
ObjectClass.hh RoutingSpace.hh helper.hh
Parameter.cc SecurityLevel.hh SecurityServer.hh
fed.hh ObjectClassSet.hh Named.hh
Subscribable.hh AuditLine.hh ObjectSet.cc
TreeNamedAndHandledSet.hh ObjectSet.hh
Parameter.hh SocketUDP.cc NetworkMessage.hh
AuditFile.cc ObjectClassSet.cc
InteractionSet.cc Message.cc MessageBuffer.cc
XmlParser.cc Named.cc AuditLine.cc
ObjectClassAttribute.cc RootObject.hh
SocketUN.cc Clock.cc AuditFile.hh Message.hh
Message_R.cc Clock.hh RootObject.cc
libRTI : RTIambassador.cc RTIambPrivateRefs.cc
Log message:
Check-in clean-up patch from Mathias
patch #6982: Consequent usage of std::string and references of that in
function arguments
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.cc?cvsroot=certi&r1=3.65&r2=3.66
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federate.cc?cvsroot=certi&r1=3.16&r2=3.17
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federate.hh?cvsroot=certi&r1=3.15&r2=3.16
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.hh?cvsroot=certi&r1=3.49&r2=3.50
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.hh?cvsroot=certi&r1=3.59&r2=3.60
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.cc?cvsroot=certi&r1=3.115&r2=3.116
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG_processing.cc?cvsroot=certi&r1=3.90&r2=3.91
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG.cc?cvsroot=certi&r1=3.59&r2=3.60
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/Statistics.cc?cvsroot=certi&r1=3.20&r2=3.21
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/OwnershipManagement.hh?cvsroot=certi&r1=3.8&r2=3.9
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/FederationManagement.hh?cvsroot=certi&r1=3.26&r2=3.27
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/ObjectManagement.cc?cvsroot=certi&r1=3.61&r2=3.62
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA_federate.cc?cvsroot=certi&r1=3.101&r2=3.102
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/DataDistribution.cc?cvsroot=certi&r1=3.30&r2=3.31
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/TimeManagement.cc?cvsroot=certi&r1=3.51&r2=3.52
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/ObjectManagement.hh?cvsroot=certi&r1=3.30&r2=3.31
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/FederationManagement.cc?cvsroot=certi&r1=3.76&r2=3.77
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/DataDistribution.hh?cvsroot=certi&r1=3.16&r2=3.17
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/OwnershipManagement.cc?cvsroot=certi&r1=3.20&r2=3.21
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/RoutingSpace.cc?cvsroot=certi&r1=3.15&r2=3.16
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassAttribute.hh?cvsroot=certi&r1=3.26&r2=3.27
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SecurityServer.cc?cvsroot=certi&r1=3.17&r2=3.18
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Interaction.cc?cvsroot=certi&r1=3.55&r2=3.56
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectAttribute.hh?cvsroot=certi&r1=3.17&r2=3.18
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/InteractionSet.hh?cvsroot=certi&r1=3.24&r2=3.25
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.cc?cvsroot=certi&r1=3.69&r2=3.70
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Interaction.hh?cvsroot=certi&r1=3.37&r2=3.38
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage.cc?cvsroot=certi&r1=3.40&r2=3.41
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.hh?cvsroot=certi&r1=3.46&r2=3.47
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/RoutingSpace.hh?cvsroot=certi&r1=3.11&r2=3.12
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/helper.hh?cvsroot=certi&r1=3.1&r2=3.2
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Parameter.cc?cvsroot=certi&r1=3.10&r2=3.11
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SecurityLevel.hh?cvsroot=certi&r1=3.11&r2=3.12
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SecurityServer.hh?cvsroot=certi&r1=3.11&r2=3.12
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/fed.hh?cvsroot=certi&r1=3.6&r2=3.7
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.hh?cvsroot=certi&r1=3.36&r2=3.37
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Named.hh?cvsroot=certi&r1=3.9&r2=3.10
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Subscribable.hh?cvsroot=certi&r1=3.7&r2=3.8
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/AuditLine.hh?cvsroot=certi&r1=3.9&r2=3.10
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectSet.cc?cvsroot=certi&r1=3.26&r2=3.27
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/TreeNamedAndHandledSet.hh?cvsroot=certi&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectSet.hh?cvsroot=certi&r1=3.14&r2=3.15
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Parameter.hh?cvsroot=certi&r1=3.7&r2=3.8
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketUDP.cc?cvsroot=certi&r1=3.25&r2=3.26
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage.hh?cvsroot=certi&r1=3.50&r2=3.51
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/AuditFile.cc?cvsroot=certi&r1=3.11&r2=3.12
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.cc?cvsroot=certi&r1=3.47&r2=3.48
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/InteractionSet.cc?cvsroot=certi&r1=3.29&r2=3.30
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message.cc?cvsroot=certi&r1=3.63&r2=3.64
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/MessageBuffer.cc?cvsroot=certi&r1=3.15&r2=3.16
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/XmlParser.cc?cvsroot=certi&r1=3.31&r2=3.32
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Named.cc?cvsroot=certi&r1=3.9&r2=3.10
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/AuditLine.cc?cvsroot=certi&r1=3.11&r2=3.12
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassAttribute.cc?cvsroot=certi&r1=3.34&r2=3.35
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/RootObject.hh?cvsroot=certi&r1=3.33&r2=3.34
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketUN.cc?cvsroot=certi&r1=3.32&r2=3.33
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Clock.cc?cvsroot=certi&r1=4.4&r2=4.5
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/AuditFile.hh?cvsroot=certi&r1=3.10&r2=3.11
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message.hh?cvsroot=certi&r1=3.55&r2=3.56
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message_R.cc?cvsroot=certi&r1=3.35&r2=3.36
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Clock.hh?cvsroot=certi&r1=4.9&r2=4.10
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/RootObject.cc?cvsroot=certi&r1=3.43&r2=3.44
http://cvs.savannah.gnu.org/viewcvs/certi/libRTI/RTIambassador.cc?cvsroot=certi&r1=3.109&r2=3.110
http://cvs.savannah.gnu.org/viewcvs/certi/libRTI/RTIambPrivateRefs.cc?cvsroot=certi&r1=3.21&r2=3.22
Patches:
Index: RTIG/FederationsList.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.cc,v
retrieving revision 3.65
retrieving revision 3.66
diff -u -b -r3.65 -r3.66
--- RTIG/FederationsList.cc 18 Nov 2009 18:50:48 -0000 3.65
+++ RTIG/FederationsList.cc 19 Nov 2009 18:15:29 -0000 3.66
@@ -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.65 2009/11/18 18:50:48 erk Exp $
+// $Id: FederationsList.cc,v 3.66 2009/11/19 18:15:29 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -280,7 +280,7 @@
*/
FederateHandle
FederationsList::addFederate(Handle handle,
- const char *name,
+ const std::string& name,
SocketTCP *tcp_link,
NM_Join_Federation_Execution& objectModelData)
throw (FederationExecutionDoesNotExist,
@@ -342,7 +342,7 @@
@param handle Federation handle
@param mc_link
*/
-void FederationsList::createFederation(const char *name,
+void FederationsList::createFederation(const std::string& name,
Handle handle,
SocketMC *mc_link)
#else
@@ -351,9 +351,9 @@
@param handle Federation handle
@param FEDid execution id. of the federation (i.e. file name)
*/
- void FederationsList::createFederation(const char *name,
+ void FederationsList::createFederation(const std::string& name,
Handle handle,
- const char *FEDid)
+ const std::string& FEDid)
#endif
throw (FederationExecutionAlreadyExists,
CouldNotOpenFED,
@@ -369,12 +369,12 @@
// It may throw RTIinternalError
checkHandle(handle);
auditFile << ", Handle : " << (long) handle ;
- if (name == NULL) throw RTIinternalError("Invalid Federation Name.");
+ if (name.empty()) throw RTIinternalError("Invalid Federation Name.");
// It should throw FederationExecutionDoesNotExist.
try {
exists(name, unused);
- D.Out(pdExcept, "Federation %s already present.", name);
+ D.Out(pdExcept, "Federation %s already present.", name.c_str());
G.Out(pdGendoc,"exit FederationsList::createFederation on exception");
throw FederationExecutionAlreadyExists(name);
}
@@ -444,7 +444,7 @@
FederateHandle federate,
ObjectHandle id,
FederationTime theTime,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
FederationExecutionDoesNotExist,
DeletePrivilegeNotHeld,
@@ -473,7 +473,7 @@
FederationsList::destroyObject(Handle handle,
FederateHandle federate,
ObjectHandle id,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
FederationExecutionDoesNotExist,
DeletePrivilegeNotHeld,
@@ -499,16 +499,14 @@
FederationList, else throw FederationExecutionDoesNotExist.
*/
void
-FederationsList::exists(const char *name,
+FederationsList::exists(const std::string& name,
Handle &handle)
throw (FederationExecutionDoesNotExist, RTIinternalError)
{
G.Out(pdGendoc,"enter FederationsList::exists");
- if (name == NULL) throw RTIinternalError("Null Federation Name.");
-
for (list<Federation *>::iterator i = begin(); i != end(); i++) {
- if (!strcmp((*i)->getName(), name)) {
+ if ((*i)->getName() == name) {
handle = (*i)->getHandle();
G.Out(pdGendoc,"exit FederationsList::exists");
return ;
@@ -583,7 +581,7 @@
searchFederation(handle, federation);
D.Out(pdTrace, "theObjectClass = %d, name = %s.", object_class,
name.c_str());
- return(federation->registerObject(federate, object_class, name.c_str()));
+ return(federation->registerObject(federate, object_class, name));
}
// ----------------------------------------------------------------------------
@@ -633,7 +631,7 @@
std::vector <AttributeValue_t> &values,
UShort list_size,
FederationTime time,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
FederationExecutionDoesNotExist,
ObjectNotKnown,
@@ -665,7 +663,7 @@
std::vector <AttributeHandle> &attributes,
std::vector <AttributeValue_t> &values,
UShort list_size,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
FederationExecutionDoesNotExist,
ObjectNotKnown,
@@ -698,7 +696,7 @@
UShort list_size,
FederationTime time,
RegionHandle region,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
FederateNotPublishing,
FederationExecutionDoesNotExist,
@@ -736,7 +734,7 @@
std::vector <ParameterValue_t> &values,
UShort list_size,
RegionHandle region,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
FederateNotPublishing,
FederationExecutionDoesNotExist,
@@ -770,8 +768,8 @@
FederationsList::manageSynchronization(Handle handle,
FederateHandle federate,
bool state,
- const char *label,
- const char *tag)
+ const std::string& label,
+ const std::string& tag)
throw (FederationAlreadyPaused,
FederationNotPaused,
FederateNotExecutionMember,
@@ -803,8 +801,8 @@
FederationsList::manageSynchronization(Handle handle,
FederateHandle federate,
bool state,
- const char *label,
- const char *tag,
+ const std::string& label,
+ const std::string& tag,
unsigned short federate_setSize,
std::vector <FederateHandle>
&federate_set)
throw (FederationAlreadyPaused,
@@ -840,8 +838,8 @@
void
FederationsList::broadcastSynchronization(Handle handle,
FederateHandle federate,
- const char *label,
- const char *tag)
+ const std::string& label,
+ const std::string& tag)
throw (FederationExecutionDoesNotExist,
RTIinternalError)
{
@@ -866,8 +864,8 @@
void
FederationsList::broadcastSynchronization(Handle handle,
FederateHandle federate,
- const char *label,
- const char *tag,
+ const std::string& label,
+ const std::string& tag,
unsigned short federate_setSize,
std::vector <FederateHandle>
&federate_set)
throw (FederationExecutionDoesNotExist,
@@ -1197,7 +1195,7 @@
ObjectHandle id,
std::vector <AttributeHandle>
&attributes,
UShort list_size,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
ObjectNotKnown,
AttributeNotDefined,
@@ -1288,7 +1286,7 @@
ObjectHandle id,
std::vector <AttributeHandle> &attributes,
UShort list_size,
- const char *tag)
+ const std::string& tag)
throw (ObjectNotKnown,
ObjectClassNotPublished,
AttributeNotDefined,
@@ -1607,7 +1605,7 @@
checkHandle(federation);
checkHandle(federate);
- return f->registerObjectWithRegion(federate, handle, tag.c_str(), region,
nb, attrs);
+ return f->registerObjectWithRegion(federate, handle, tag, region, nb,
attrs);
}
// ----------------------------------------------------------------------------
@@ -1615,7 +1613,7 @@
void
FederationsList::requestFederationSave(Handle the_federation,
FederateHandle the_federate,
- const char *the_label,
+ const std::string& the_label,
FederationTime the_time)
{
G.Out(pdGendoc,"enter FederationsList::requestFederationSave with time");
@@ -1636,7 +1634,7 @@
void
FederationsList::requestFederationSave(Handle the_federation,
FederateHandle the_federate,
- const char *the_label)
+ const std::string& the_label)
{
G.Out(pdGendoc,"enter FederationsList::requestFederationSave without
time");
@@ -1691,7 +1689,7 @@
void
FederationsList::requestFederationRestore(Handle the_federation,
FederateHandle the_federate,
- const char *the_label)
+ const std::string& the_label)
{
G.Out(pdGendoc,"enter FederationsList::requestFederationRestore");
checkHandle(the_federation);
@@ -1750,5 +1748,5 @@
}} // certi::rtig
-// EOF $Id: FederationsList.cc,v 3.65 2009/11/18 18:50:48 erk Exp $
+// EOF $Id: FederationsList.cc,v 3.66 2009/11/19 18:15:29 erk Exp $
Index: RTIG/Federate.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federate.cc,v
retrieving revision 3.16
retrieving revision 3.17
diff -u -b -r3.16 -r3.17
--- RTIG/Federate.cc 20 Nov 2008 18:21:55 -0000 3.16
+++ RTIG/Federate.cc 19 Nov 2009 18:15:29 -0000 3.17
@@ -16,7 +16,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: Federate.cc,v 3.16 2008/11/20 18:21:55 approx Exp $
+// $Id: Federate.cc,v 3.17 2009/11/19 18:15:29 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -41,7 +41,7 @@
// ----------------------------------------------------------------------------
//! A new FederateName is allocated. theLink must have been opened before.
-Federate::Federate(const char *the_name, FederateHandle the_handle)
+Federate::Federate(const std::string& the_name, FederateHandle the_handle)
throw (RTIinternalError)
: handle(the_handle), name(the_name), regulator(false), constrained(false),
cras(true), iras(true), aras(false), asas(false),
@@ -54,15 +54,14 @@
// ----------------------------------------------------------------------------
//! Add a synchronization label to federate.
void
-Federate::addSynchronizationLabel(const char *label)
+Federate::addSynchronizationLabel(const std::string& label)
throw (RTIinternalError)
{
G.Out(pdGendoc,"enter Federate::addSynchronizationLabel");
- string s = label ;
- SyncList::iterator it = std::find(syncLabels.begin(), syncLabels.end(), s);
+ SyncList::iterator it = std::find(syncLabels.begin(), syncLabels.end(),
label);
if (it == syncLabels.end())
- syncLabels.push_back(s);
+ syncLabels.push_back(label);
else
throw RTIinternalError("Synchronization label pending in federate.");
@@ -73,11 +72,10 @@
// ----------------------------------------------------------------------------
//! Removes a synchronization label from federate.
void
-Federate::removeSynchronizationLabel(const char *label)
+Federate::removeSynchronizationLabel(const std::string& label)
throw (RTIinternalError)
{
- string s = label ;
- SyncList::iterator it = std::find(syncLabels.begin(), syncLabels.end(), s);
+ SyncList::iterator it = std::find(syncLabels.begin(), syncLabels.end(),
label);
if (it == syncLabels.end())
throw RTIinternalError("Synch. label not in federate.");
else
@@ -87,11 +85,11 @@
// ----------------------------------------------------------------------------
//! Returns whether the federate is already synchronized with this label.
bool
-Federate::isSynchronizationLabel(const char *label) const
+Federate::isSynchronizationLabel(const std::string& label) const
{
- return std::find(syncLabels.begin(), syncLabels.end(), string(label)) !=
syncLabels.end();
+ return std::find(syncLabels.begin(), syncLabels.end(), label) !=
syncLabels.end();
}
}}
-// $Id: Federate.cc,v 3.16 2008/11/20 18:21:55 approx Exp $
+// $Id: Federate.cc,v 3.17 2009/11/19 18:15:29 erk Exp $
Index: RTIG/Federate.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/Federate.hh,v
retrieving revision 3.15
retrieving revision 3.16
diff -u -b -r3.15 -r3.16
--- RTIG/Federate.hh 7 Dec 2008 20:16:11 -0000 3.15
+++ RTIG/Federate.hh 19 Nov 2009 18:15:29 -0000 3.16
@@ -16,7 +16,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: Federate.hh,v 3.15 2008/12/07 20:16:11 gotthardp Exp $
+// $Id: Federate.hh,v 3.16 2009/11/19 18:15:29 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_RTIG_FEDERATE_HH
@@ -36,12 +36,12 @@
class Federate
{
public:
- Federate(const char *the_name, FederateHandle) throw (RTIinternalError);
+ Federate(const std::string& the_name, FederateHandle) throw
(RTIinternalError);
FederateHandle getHandle() const { return handle ; };
void setHandle(FederateHandle h) { handle = h ; };
- const char *getName() const { return name.c_str(); };
+ const std::string& getName() const { return name; };
bool isConstrained() const { return constrained ; };
bool isRegulator() const { return regulator ; };
void setConstrained(bool c) { constrained = c ; };
@@ -112,9 +112,9 @@
void setSaving(bool s) { saving = s ; };
void setRestoring(bool r) { restoring = r ; };
- void addSynchronizationLabel(const char *) throw (RTIinternalError);
- void removeSynchronizationLabel(const char *) throw (RTIinternalError);
- bool isSynchronizationLabel(const char *) const ;
+ void addSynchronizationLabel(const std::string&) throw (RTIinternalError);
+ void removeSynchronizationLabel(const std::string&) throw
(RTIinternalError);
+ bool isSynchronizationLabel(const std::string&) const ;
private:
FederateHandle handle ; //!< Federate ID.
@@ -141,4 +141,4 @@
#endif // CERTI_RTIG_FEDERATE_HH
-// $Id: Federate.hh,v 3.15 2008/12/07 20:16:11 gotthardp Exp $
+// $Id: Federate.hh,v 3.16 2009/11/19 18:15:29 erk Exp $
Index: RTIG/FederationsList.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.hh,v
retrieving revision 3.49
retrieving revision 3.50
diff -u -b -r3.49 -r3.50
--- RTIG/FederationsList.hh 18 Nov 2009 18:50:48 -0000 3.49
+++ RTIG/FederationsList.hh 19 Nov 2009 18:15:29 -0000 3.50
@@ -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.49 2009/11/18 18:50:48 erk Exp $
+// $Id: FederationsList.hh,v 3.50 2009/11/19 18:15:29 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIG_FEDERATIONS_LIST_HH
@@ -54,9 +54,9 @@
// MAX_FEDERATION is the maximum number of federations.
#ifdef FEDERATION_USES_MULTICAST
- void createFederation(const char *, FederationHandle, SocketMC*)
+ void createFederation(const std::string&, FederationHandle, SocketMC*)
#else
- void createFederation(const char *, Handle, const char *FEDid)
+ void createFederation(const std::string&, Handle, const std::string&
FEDid)
#endif
throw (FederationExecutionAlreadyExists,
CouldNotOpenFED,
@@ -65,7 +65,7 @@
SecurityError,
RTIinternalError);
- void exists(const char *name, Handle &handle)
+ void exists(const std::string& name, Handle &handle)
throw (FederationExecutionDoesNotExist, RTIinternalError);
void destroyFederation(Handle)
@@ -90,8 +90,8 @@
void manageSynchronization(Handle theHandle,
FederateHandle theFederate,
bool state,
- const char *the_label,
- const char *the_tag)
+ const std::string& the_label,
+ const std::string& the_tag)
throw (FederationAlreadyPaused,
FederationNotPaused,
FederateNotExecutionMember,
@@ -102,8 +102,8 @@
void manageSynchronization(Handle theHandle,
FederateHandle theFederate,
bool state,
- const char *the_label,
- const char *the_tag,
+ const std::string& the_label,
+ const std::string& the_tag,
unsigned short federate_setSize,
std::vector <FederateHandle> &federate_set)
throw (FederationAlreadyPaused,
@@ -115,15 +115,15 @@
void broadcastSynchronization(Handle handle,
FederateHandle federate,
- const char *label,
- const char *tag)
+ const std::string& label,
+ const std::string& tag)
throw (FederationExecutionDoesNotExist,
RTIinternalError);
void broadcastSynchronization(Handle handle,
FederateHandle federate,
- const char *label,
- const char *tag,
+ const std::string& label,
+ const std::string& tag,
unsigned short federate_setSize,
std::vector <FederateHandle> &federate_set)
throw (FederationExecutionDoesNotExist,
@@ -131,19 +131,19 @@
void requestFederationSave(Handle the_federation,
FederateHandle the_federate,
- const char *the_label,
+ const std::string& the_label,
FederationTime the_time);
void requestFederationSave(Handle the_federation,
FederateHandle the_federate,
- const char *the_label);
+ const std::string& the_label);
void federateSaveBegun(Handle, FederateHandle);
void federateSaveStatus(Handle, FederateHandle, bool);
void requestFederationRestore(Handle the_federation,
FederateHandle the_federate,
- const char *the_label);
+ const std::string& the_label);
void federateRestoreStatus(Handle the_federation,
FederateHandle the_federate,
@@ -153,7 +153,7 @@
// -- Federate Management --
// -------------------------
FederateHandle addFederate(Handle theHandle,
- const char *theFederateName,
+ const std::string& theFederateName,
SocketTCP *theTCPLink,
NM_Join_Federation_Execution& objectModelData)
throw (FederationExecutionDoesNotExist,
@@ -337,7 +337,7 @@
FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
FederationTime theTime,
- const char *theUserTag)
+ const std::string& theUserTag)
throw (FederateNotExecutionMember,
FederationExecutionDoesNotExist,
DeletePrivilegeNotHeld,
@@ -351,7 +351,7 @@
void destroyObject(Handle theHandle,
FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
- const char *theUserTag)
+ const std::string& theUserTag)
throw (FederateNotExecutionMember,
FederationExecutionDoesNotExist,
DeletePrivilegeNotHeld,
@@ -367,7 +367,7 @@
std::vector <AttributeValue_t> &theValueList,
UShort theListSize,
FederationTime theTime,
- const char *theTag)
+ const std::string& theTag)
throw (FederateNotExecutionMember,
FederationExecutionDoesNotExist,
ObjectNotKnown,
@@ -383,7 +383,7 @@
std::vector <AttributeHandle> &theAttributeList,
std::vector <AttributeValue_t> &theValueList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (FederateNotExecutionMember,
FederationExecutionDoesNotExist,
ObjectNotKnown,
@@ -429,7 +429,7 @@
UShort theListSize,
FederationTime theTime,
RegionHandle,
- const char *theTag)
+ const std::string& theTag)
throw (FederateNotExecutionMember,
FederateNotPublishing,
FederationExecutionDoesNotExist,
@@ -446,7 +446,7 @@
std::vector <ParameterValue_t> &theValueList,
UShort theListSize,
RegionHandle,
- const char *theTag)
+ const std::string& theTag)
throw (FederateNotExecutionMember,
FederateNotPublishing,
FederationExecutionDoesNotExist,
@@ -486,7 +486,7 @@
ObjectHandle,
std::vector <AttributeHandle>&,
UShort,
- const char *)
+ const std::string& )
throw (FederateNotExecutionMember,
ObjectNotKnown,
AttributeNotDefined,
@@ -530,7 +530,7 @@
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (ObjectNotKnown,
ObjectClassNotPublished,
AttributeNotDefined,
@@ -650,4 +650,4 @@
#endif // _CERTI_RTIG_FEDERATIONS_LIST_HH
-// $Id: FederationsList.hh,v 3.49 2009/11/18 18:50:48 erk Exp $
+// $Id: FederationsList.hh,v 3.50 2009/11/19 18:15:29 erk Exp $
Index: RTIG/Federation.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.hh,v
retrieving revision 3.59
retrieving revision 3.60
diff -u -b -r3.59 -r3.60
--- RTIG/Federation.hh 18 Nov 2009 18:50:48 -0000 3.59
+++ RTIG/Federation.hh 19 Nov 2009 18:15:29 -0000 3.60
@@ -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.59 2009/11/18 18:50:48 erk Exp $
+// $Id: Federation.hh,v 3.60 2009/11/19 18:15:29 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIG_FEDERATION_HH
@@ -60,7 +60,7 @@
std::string FEDid ;
//! Labels and Tags not on synchronization.
- std::map<const char *, const char *> synchronizationLabels ;
+ std::map<std::string, std::string> synchronizationLabels ;
HandleManager<FederateHandle> federateHandles ;
HandleManager<ObjectHandle> objectHandles ;
@@ -93,7 +93,7 @@
* @param audit_server
* @param mc_link
*/
- Federation(const char *,
+ Federation(const std::string&,
FederationHandle,
SocketServer &,
AuditFile &,
@@ -110,7 +110,7 @@
* @param audit_server
* @param FEDid_name i.e. FED file name (may be a .fed or a
.xml file)
*/
- Federation(const char *, Handle, SocketServer &, AuditFile &, const
char *, int theVerboseLevel)
+ Federation(const std::string&, Handle, SocketServer &, AuditFile &,
const std::string&, int theVerboseLevel)
#endif
throw (CouldNotOpenFED, ErrorReadingFED, MemoryExhausted,
SecurityError,
RTIinternalError);
@@ -121,13 +121,13 @@
int getNbRegulators() const ;
bool isSynchronizing() const ;
Handle getHandle() const ;
- const char *getName() const ;
- const char *getFEDid() const ;
+ const std::string& getName() const ;
+ const std::string& getFEDid() const ;
// -------------------------
// -- Federate Management --
// -------------------------
- FederateHandle add(const char *theName, SocketTCP *theTCPLink)
+ FederateHandle add(const std::string& theName, SocketTCP *theTCPLink)
throw (FederateAlreadyExecutionMember,
MemoryExhausted,
RTIinternalError);
@@ -184,8 +184,8 @@
// Synchronization Management.
void registerSynchronization(FederateHandle the_federate,
- const char *the_label,
- const char *the_tag)
+ const std::string& the_label,
+ const std::string& the_tag)
throw (FederateNotExecutionMember,
FederationAlreadyPaused,
SaveInProgress,
@@ -193,8 +193,8 @@
RTIinternalError);
void registerSynchronization(FederateHandle the_federate,
- const char *the_label,
- const char *the_tag,
+ const std::string& the_label,
+ const std::string& the_tag,
unsigned short federate_setSize,
std::vector <FederateHandle> &federate_set)
throw (FederateNotExecutionMember,
@@ -204,7 +204,7 @@
RTIinternalError);
void unregisterSynchronization(FederateHandle theFederate,
- const char *theLabel)
+ const std::string& theLabel)
throw (FederateNotExecutionMember,
FederationNotPaused,
SaveInProgress,
@@ -212,22 +212,22 @@
RTIinternalError);
void broadcastSynchronization(FederateHandle federate,
- const char *label,
- const char *tag)
+ const std::string& label,
+ const std::string& tag)
throw (RTIinternalError);
void broadcastSynchronization(FederateHandle federate,
- const char *label,
- const char *tag,
+ const std::string& label,
+ const std::string& tag,
unsigned short federate_setSize,
std::vector <FederateHandle> &federate_set)
throw (RTIinternalError);
// Save Management.
- void requestFederationSave(FederateHandle, const char *, FederationTime)
+ void requestFederationSave(FederateHandle, const std::string&,
FederationTime)
throw (FederateNotExecutionMember, SaveInProgress);
- void requestFederationSave(FederateHandle, const char *)
+ void requestFederationSave(FederateHandle, const std::string&)
throw (FederateNotExecutionMember, SaveInProgress);
@@ -238,7 +238,7 @@
throw (FederateNotExecutionMember);
void requestFederationRestore(FederateHandle the_federate,
- const char *the_label)
+ const std::string& the_label)
throw (FederateNotExecutionMember);
void federateRestoreStatus(FederateHandle the_federate,
@@ -252,7 +252,7 @@
void deleteObject(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
FederationTime theTime,
- const char *theUserTag)
+ const std::string& theUserTag)
throw (FederateNotExecutionMember,
DeletePrivilegeNotHeld,
ObjectNotKnown,
@@ -263,7 +263,7 @@
void deleteObject(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
- const char *theUserTag)
+ const std::string& theUserTag)
throw (FederateNotExecutionMember,
DeletePrivilegeNotHeld,
ObjectNotKnown,
@@ -286,7 +286,7 @@
ObjectHandle registerObject(FederateHandle theFederateHandle,
ObjectClassHandle theClass,
- const char *theName)
+ const std::string& theName)
throw (FederateNotExecutionMember,
FederateNotPublishing,
ObjectAlreadyRegistered,
@@ -329,7 +329,7 @@
std::vector <AttributeValue_t> &theValueList,
UShort theListSize,
FederationTime theTime,
- const char *theTag)
+ const std::string& theTag)
throw (FederateNotExecutionMember,
ObjectNotKnown,
AttributeNotDefined,
@@ -343,7 +343,7 @@
std::vector <AttributeHandle> &theAttributeList,
std::vector <AttributeValue_t> &theValueList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (FederateNotExecutionMember,
ObjectNotKnown,
AttributeNotDefined,
@@ -363,7 +363,7 @@
UShort theListSize,
FederationTime theTime,
RegionHandle,
- const char *theTag)
+ const std::string& theTag)
throw (FederateNotExecutionMember,
FederateNotPublishing,
InteractionClassNotDefined,
@@ -378,7 +378,7 @@
std::vector <ParameterValue_t> &theValueList,
UShort theListSize,
RegionHandle,
- const char *theTag)
+ const std::string& theTag)
throw (FederateNotExecutionMember,
FederateNotPublishing,
InteractionClassNotDefined,
@@ -436,7 +436,7 @@
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (FederateNotExecutionMember,
ObjectNotKnown,
AttributeNotDefined,
@@ -477,7 +477,7 @@
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (ObjectNotKnown,
ObjectClassNotPublished,
AttributeNotDefined,
@@ -592,7 +592,7 @@
RTIinternalError);
ObjectHandle registerObjectWithRegion(FederateHandle,ObjectClassHandle,
- const char *, RegionHandle, int,
+ const std::string&, RegionHandle, int,
std::vector <AttributeHandle> &)
throw (ObjectClassNotDefined, ObjectClassNotPublished,
AttributeNotDefined, AttributeNotPublished, RegionNotKnown,
@@ -659,7 +659,7 @@
void broadcastSomeMessage(NetworkMessage *msg, FederateHandle Except,
std::vector <FederateHandle> &fede_array, int nbfed);
- Federate &getFederate(const char *theName)
+ Federate &getFederate(const std::string& theName)
throw (FederateNotExecutionMember);
Federate &getFederate(FederateHandle theHandle)
@@ -687,4 +687,4 @@
#endif // _CERTI_RTIG_FEDERATION_HH
-// $Id: Federation.hh,v 3.59 2009/11/18 18:50:48 erk Exp $
+// $Id: Federation.hh,v 3.60 2009/11/19 18:15:29 erk Exp $
Index: RTIG/Federation.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.cc,v
retrieving revision 3.115
retrieving revision 3.116
diff -u -b -r3.115 -r3.116
--- RTIG/Federation.cc 18 Nov 2009 18:50:48 -0000 3.115
+++ RTIG/Federation.cc 19 Nov 2009 18:15:29 -0000 3.116
@@ -18,14 +18,13 @@
// 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.115 2009/11/18 18:50:48 erk Exp $
+// $Id: Federation.cc,v 3.116 2009/11/19 18:15:29 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
#include "Federation.hh"
#include "NM_Classes.hh"
#include <sstream>
-#include <cassert>
#include <memory>
#include "fed.hh"
@@ -99,18 +98,18 @@
#ifdef FEDERATION_USES_MULTICAST
-Federation::Federation(const char *federation_name,
+Federation::Federation(const std::string& federation_name,
FederationHandle federation_handle,
SocketServer &socket_server,
AuditFile &audit_server,
SocketMC *mc_link,
int theVerboseLevel)
#else
- Federation::Federation(const char *federation_name,
+ Federation::Federation(const std::string& federation_name,
Handle federation_handle,
SocketServer &socket_server,
AuditFile &audit_server,
- const char *FEDid_name,
+ const std::string& FEDid_name,
int theVerboseLevel)
#endif
throw (CouldNotOpenFED, ErrorReadingFED, MemoryExhausted, SecurityError,
@@ -136,14 +135,14 @@
G.Out(pdGendoc,"enter Federation::Federation");
// Allocates Name
- if ((federation_name == NULL) || (federation_handle == 0))
+ if (federation_name.empty() || (federation_handle == 0))
throw RTIinternalError("Null init parameter in Federation creation.");
- name = std::string(federation_name);
+ name = federation_name;
// Default Attribute values
handle = federation_handle;
- FEDid = std::string(FEDid_name);
+ FEDid = FEDid_name;
D.Out(pdInit, "New Federation created with Handle %d, now reading FOM.",
handle);
@@ -188,7 +187,7 @@
}
GetCurrentDirectory(260,temp);
filename = string(temp);
- filename = filename + "\\share\\federations\\"+string(FEDid_name);
+ filename = filename + "\\share\\federations\\"+FEDid_name;
if (verboseLevel>0) {
cout << " Now trying..." << filename;
}
@@ -210,7 +209,7 @@
if (verboseLevel>0) {
cout << " --> cannot access." <<endl;
}
- filename = PACKAGE_INSTALL_PREFIX
"\\share\\federations\\"+string(FEDid_name);
+ filename = PACKAGE_INSTALL_PREFIX "\\share\\federations\\"+FEDid_name;
if (verboseLevel>0) {
cout << " Now trying..." << filename;
}
@@ -232,7 +231,7 @@
if (verboseLevel>0) {
cout << " --> cannot access." << endl;
}
- filename = PACKAGE_INSTALL_PREFIX
"/share/federations/"+string(FEDid_name);
+ filename = PACKAGE_INSTALL_PREFIX "/share/federations/"+FEDid_name;
if (verboseLevel>0) {
cout << " Now trying..." << filename;
}
@@ -243,7 +242,7 @@
if (verboseLevel>0) {
cout << " --> cannot access." << endl;
}
- filename = "/usr/local/share/federations/"+string(FEDid_name);
+ filename = "/usr/local/share/federations/"+FEDid_name;
if (verboseLevel>0) {
cout << " Now trying..." << filename;
}
@@ -349,7 +348,7 @@
{
if (XmlParser::exists()) {
XmlParser *parser = new XmlParser(root);
- server->audit << ", XML File : " << filename.c_str() ;
+ server->audit << ", XML File : " << filename ;
try {
parser->parse(filename);
@@ -425,10 +424,10 @@
// ----------------------------------------------------------------------------
//! Returns the federation name given in 'Create Federation Execution'.
-const char *
+const std::string&
Federation::getName() const
{
- return name.c_str() ;
+ return name;
}
// ----------------------------------------------------------------------------
@@ -441,10 +440,10 @@
// ----------------------------------------------------------------------------
//! Returns the FEDid name given in 'Create Federation Execution'.
-const char *
+const std::string&
Federation::getFEDid() const
{
- return FEDid.c_str() ;
+ return FEDid;
}
// ----------------------------------------------------------------------------
@@ -454,14 +453,9 @@
finally a RequestPause message if the Federation is already paused.
*/
FederateHandle
-Federation::add(const char *federate_name, SocketTCP *tcp_link)
+Federation::add(const std::string& federate_name, SocketTCP *tcp_link)
throw (FederateAlreadyExecutionMember, MemoryExhausted, RTIinternalError)
{
- if (federate_name == 0) {
- D.Out(pdExcept, "Tried to add a NULL named federate.");
- throw RTIinternalError("Tried to add NULL federate to federation.");
- }
-
try {
getFederate(federate_name);
throw FederateAlreadyExecutionMember("");
@@ -499,13 +493,13 @@
ASPMessage.federate = federate_handle ;
ASPMessage.federation = handle ;
- std::map<const char *, const char *>::const_iterator i ;
+ std::map<std::string, std::string>::const_iterator i ;
i = synchronizationLabels.begin();
for (; i != synchronizationLabels.end(); i++) {
ASPMessage.setLabel((*i).first);
ASPMessage.setTag((*i).second);
D.Out(pdTerm, "Sending synchronization message %s (type %d)"
- " to the new Federate.", (*i).first,
ASPMessage.getType());
+ " to the new Federate.", (*i).first.c_str(),
ASPMessage.getType());
ASPMessage.send(tcp_link,NM_msgBufSend);
federates.back().addSynchronizationLabel((*i).first);
@@ -854,7 +848,7 @@
UShort list_size,
FederationTime time,
RegionHandle region_handle,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
FederateNotPublishing,
InteractionClassNotDefined,
@@ -902,7 +896,7 @@
std::vector <ParameterValue_t>
¶meter_values,
UShort list_size,
RegionHandle region_handle,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
FederateNotPublishing,
InteractionClassNotDefined,
@@ -951,7 +945,7 @@
Federation::deleteObject(FederateHandle federate,
ObjectHandle id,
FederationTime theTime,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
DeletePrivilegeNotHeld,
ObjectNotKnown,
@@ -978,7 +972,7 @@
void
Federation::deleteObject(FederateHandle federate,
ObjectHandle id,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
DeletePrivilegeNotHeld,
ObjectNotKnown,
@@ -1000,8 +994,8 @@
//! Add a new synchronization point to federation.
void
Federation::registerSynchronization(FederateHandle federate,
- const char *label,
- const char *tag)
+ const std::string& label,
+ const std::string& tag)
throw (FederateNotExecutionMember,
FederationAlreadyPaused,
SaveInProgress,
@@ -1013,21 +1007,20 @@
this->check(federate); // It may throw FederateNotExecutionMember.
- if (label == NULL )
+ if (label.empty())
throw RTIinternalError("Bad pause label(null).");
// Verify label does not already exists
- std::map<const char *, const char *>::const_iterator i ;
+ std::map<std::string, std::string>::const_iterator i ;
i = synchronizationLabels.begin();
for (; i != synchronizationLabels.end(); i++) {
- if (!strcmp((*i).first, label)) {
+ if (i->first == label) {
throw FederationAlreadyPaused(""); // Label already pending.
}
}
// If not already in pending labels, insert to list.
- synchronizationLabels.insert(pair<const char *, const char
*>(strdup(label),
-
strdup(tag)));
+ synchronizationLabels.insert(pair<const std::string, std::string>(label,
tag));
// Add label to each federate (may throw RTIinternalError).
FederateList::iterator j ;
@@ -1047,8 +1040,8 @@
//! Add a new synchronization point (with federates set) to federation.
void
Federation::registerSynchronization(FederateHandle federate,
- const char *label,
- const char *tag,
+ const std::string& label,
+ const std::string& tag,
unsigned short federate_setSize,
std::vector <FederateHandle> &federate_set)
throw (FederateNotExecutionMember,
@@ -1062,21 +1055,20 @@
this->check(federate); // It may throw FederateNotExecutionMember.
- if (label == NULL)
+ if (label.empty())
throw RTIinternalError("Bad pause label(null).");
// Verify label does not already exists
- std::map<const char *, const char *>::const_iterator i ;
+ std::map<std::string, std::string>::const_iterator i ;
i = synchronizationLabels.begin();
for (; i != synchronizationLabels.end(); i++) {
- if (!strcmp((*i).first, label)) {
+ if (i->first == label) {
throw FederationAlreadyPaused(""); // Label already pending.
}
}
// If not already in pending labels, insert to list.
- synchronizationLabels.insert(pair<const char *, const char
*>(strdup(label),
-
strdup(tag)));
+ synchronizationLabels.insert(pair<const std::string, std::string>(label,
tag));
// Add label to each federate into the set only (may throw
RTIinternalError).
FederateList::iterator j ;
@@ -1103,8 +1095,8 @@
*/
void
Federation::broadcastSynchronization(FederateHandle federate,
- const char *label,
- const char *tag)
+ const std::string& label,
+ const std::string& tag)
throw (RTIinternalError)
{
@@ -1112,7 +1104,7 @@
this->check(federate); // It may throw FederateNotExecutionMember.
- if (label == NULL)
+ if (label.empty())
throw RTIinternalError("Bad pause label(null).");
// broadcast announceSynchronizationPoint() to all federates in federation.
@@ -1136,8 +1128,8 @@
*/
void
Federation::broadcastSynchronization(FederateHandle federate,
- const char *label,
- const char *tag,
+ const std::string& label,
+ const std::string& tag,
unsigned short federate_setSize,
std::vector <FederateHandle>
&federate_set)
throw (RTIinternalError)
@@ -1147,7 +1139,7 @@
this->check(federate); // It may throw FederateNotExecutionMember.
- if (label == NULL)
+ if (label.empty())
throw RTIinternalError("Bad pause label(null or too long).");
// broadcast announceSynchronizationPoint() to all federates in federation.
@@ -1173,7 +1165,7 @@
*/
void
Federation::requestFederationSave(FederateHandle the_federate,
- const char *the_label,
+ const std::string& the_label,
FederationTime time )
throw (FederateNotExecutionMember, SaveInProgress)
{
@@ -1213,7 +1205,7 @@
*/
void
Federation::requestFederationSave(FederateHandle the_federate,
- const char *the_label)
+ const std::string& the_label)
throw (FederateNotExecutionMember, SaveInProgress)
{
G.Out(pdGendoc,"enter Federation::requestFederationSave without time");
@@ -1306,7 +1298,7 @@
//! Informs that a federate is requesting a save.
void
Federation::requestFederationRestore(FederateHandle the_federate,
- const char *the_label)
+ const std::string& the_label)
throw (FederateNotExecutionMember)
{
G.Out(pdGendoc,"enter Federation::requestFederationRestore");
@@ -1324,7 +1316,7 @@
// At this point, only verify that file is present.
bool success = true ;
#ifdef HAVE_XML
- string filename = string(name) + "_" + string(the_label) + ".xcs" ;
+ string filename = name + "_" + the_label + ".xcs" ;
doc = xmlParseFile(filename.c_str());
// Did libXML manage to parse the file ?
@@ -1458,11 +1450,11 @@
// ----------------------------------------------------------------------------
//! Return the Federate whose Name is theName, if found.
Federate &
-Federation::getFederate(const char *federate_name)
+Federation::getFederate(const std::string& federate_name)
throw (FederateNotExecutionMember)
{
for (FederateList::iterator i = federates.begin(); i != federates.end();
++i) {
- if (strcmp(i->getName(), federate_name) == 0)
+ if (i->getName() == federate_name)
return *i ;
}
@@ -1597,7 +1589,7 @@
ObjectHandle
Federation::registerObject(FederateHandle federate,
ObjectClassHandle class_handle,
- const char *object_name)
+ const std::string& object_name)
throw (FederateNotExecutionMember,
FederateNotPublishing,
ObjectAlreadyRegistered,
@@ -1615,15 +1607,20 @@
"Federation %d: Federate %d registering Object %d of Class %d.",
handle, federate, new_id, class_handle);
+ string strname;
+ if (!object_name.empty()) {
+ strname = object_name;
+ } else {
// create a name if necessary
- string strname = "" ;
- strname += object_name ? string(object_name) : "HLA" + new_id ;
+ std::stringstream ss;
+ ss << "HLAObject_" << new_id;
+ strname = ss.str();
+ }
// Register Object.
try
{
- root->registerObjectInstance(federate, class_handle, new_id,
- strname.c_str());
+ root->registerObjectInstance(federate, class_handle, new_id, strname);
}
catch(...)
{ //If an exception was thrown, the object instance was not added
@@ -1717,7 +1714,7 @@
//! unregisterSynchronization.
void
Federation::unregisterSynchronization(FederateHandle federate_handle,
- const char *label)
+ const std::string& label)
throw (FederateNotExecutionMember,
FederationNotPaused,
SaveInProgress,
@@ -1729,7 +1726,7 @@
this->check(federate_handle); // It may throw FederateNotExecutionMember.
- if (label == NULL)
+ if (label.empty())
throw RTIinternalError("Bad pause label(null).");
// Set federate synchronized on this label.
@@ -1746,13 +1743,10 @@
D.Out(pdTerm, "Federation %d is not Paused anymore.", handle);
// Remove label from federation list.
- std::map<const char *, const char *>::iterator i ;
+ std::map<std::string, std::string>::iterator i ;
i = synchronizationLabels.begin();
for (; i != synchronizationLabels.end(); i++) {
- if (!strcmp((*i).first, label)) {
- // Allocated by strdup().
- free(const_cast<char *>((*i).first));
- free(const_cast<char *>((*i).second));
+ if (i->first == label) {
synchronizationLabels.erase(i);
break ;
}
@@ -1766,7 +1760,7 @@
broadcastAnyMessage(&msg, 0);
- D.Out(pdTerm, "Federation %d is synchronized on %s.", handle, label);
+ D.Out(pdTerm, "Federation %d is synchronized on %s.", handle,
label.c_str());
G.Out(pdGendoc,"exit Federation::unregisterSynchronization");
@@ -1925,7 +1919,7 @@
std::vector <AttributeValue_t> &values,
UShort list_size,
FederationTime time,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
ObjectNotKnown,
AttributeNotDefined,
@@ -1957,7 +1951,7 @@
std::vector <AttributeHandle> &attributes,
std::vector <AttributeValue_t> &values,
UShort list_size,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
ObjectNotKnown,
AttributeNotDefined,
@@ -2061,7 +2055,7 @@
ObjectHandle id,
std::vector <AttributeHandle> &attribs,
UShort list_size,
- const char *tag)
+ const std::string& tag)
throw (FederateNotExecutionMember,
ObjectNotKnown,
AttributeNotDefined,
@@ -2145,7 +2139,7 @@
ObjectHandle id,
std::vector <AttributeHandle> &attributes,
UShort list_size,
- const char *tag)
+ const std::string& tag)
throw (ObjectNotKnown,
ObjectClassNotPublished,
AttributeNotDefined,
@@ -2411,7 +2405,7 @@
ObjectHandle
Federation::registerObjectWithRegion(FederateHandle federate,
ObjectClassHandle class_handle,
- const char *object_name,
+ const std::string& object_name,
RegionHandle region_handle,
int nb,
std::vector <AttributeHandle> &attributes)
@@ -2429,11 +2423,17 @@
Debug(D, pdDebug) << "Register object with region : Object " << object
<< ", class " << class_handle << ", region " << region_handle
<< std::endl ;
- string strname = "" ; // create a name if necessary
- strname += object_name ? string(object_name) : "HLA" + object ;
+ string strname;
+ if (!object_name.empty()) {
+ strname = object_name;
+ } else {
+ // create a name if necessary
+ std::stringstream ss;
+ ss << "HLAObject_" << object;
+ strname = ss.str();
+ }
- root->registerObjectInstance(federate, class_handle, object,
- strname.c_str());
+ root->registerObjectInstance(federate, class_handle, object, strname);
Debug(D, pdDebug) << "- object \"" << strname
<< "\" registered" << std::endl ;
@@ -2491,7 +2491,7 @@
while (cur != NULL) {
if ((!xmlStrcmp(cur->name, NODE_FEDERATE))) {
for (FederateList::iterator i = federates.begin(); i !=
federates.end(); ++i) {
- if (!strcmp(i->getName(),XmlParser::CleanXmlGetProp(cur,
(const xmlChar*) "name"))) {
+ if
(!strcmp(i->getName().c_str(),XmlParser::CleanXmlGetProp(cur, (const xmlChar*)
"name"))) {
// Set federate constrained status
if (!strcmp("true", XmlParser::CleanXmlGetProp(cur, (const
xmlChar*) "constrained"))) {
status = true ;
@@ -2545,7 +2545,7 @@
xmlSetProp(federate,
(const xmlChar *) "name",
- (const xmlChar *) i->getName());
+ (const xmlChar *) i->getName().c_str());
sprintf(t, "%ld", i->getHandle());
xmlSetProp(federate, (const xmlChar *) "handle", (const xmlChar *) t);
@@ -2559,7 +2559,7 @@
xmlSetDocCompressMode(doc, 9);
- string filename = string(name) + "_" + string(saveLabel) + ".xcs" ;
+ string filename = name + "_" + saveLabel + ".xcs" ;
xmlSaveFile(filename.c_str(), doc);
// TODO: tests
@@ -2612,5 +2612,5 @@
}} // namespace certi/rtig
-// $Id: Federation.cc,v 3.115 2009/11/18 18:50:48 erk Exp $
+// $Id: Federation.cc,v 3.116 2009/11/19 18:15:29 erk Exp $
Index: RTIG/RTIG_processing.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG_processing.cc,v
retrieving revision 3.90
retrieving revision 3.91
diff -u -b -r3.90 -r3.91
--- RTIG/RTIG_processing.cc 18 Nov 2009 18:50:48 -0000 3.90
+++ RTIG/RTIG_processing.cc 19 Nov 2009 18:15:29 -0000 3.91
@@ -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.90 2009/11/18 18:50:48 erk Exp $
+// $Id: RTIG_processing.cc,v 3.91 2009/11/19 18:15:29 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -27,6 +27,7 @@
#include <iostream>
#include <cassert>
+#include <cstring>
#include <memory>
using std::endl ;
@@ -56,7 +57,7 @@
throw RTIinternalError("Invalid Federation Name.");
}
- auditServer << "Federation Name : " << federation.c_str() ;
+ auditServer << "Federation Name : " << federation;
Handle h = federationHandles.provide();
#ifdef FEDERATION_USES_MULTICAST
@@ -84,7 +85,7 @@
// We catch createFederation because it is useful to send
// exception reason to RTIA
try {
- federations.createFederation(federation.c_str(), h, FEDid.c_str());
+ federations.createFederation(federation, h, FEDid);
}
catch (CouldNotOpenFED e)
{
@@ -147,17 +148,17 @@
if (federation.empty() || federate.empty())
throw RTIinternalError("Invalid Federation/Federate Name.");
- auditServer << "Federate \"" << federate.c_str() << "\" joins Federation
\""
- << federation.c_str() << "\"" ;
+ auditServer << "Federate \"" << federate << "\" joins Federation \""
+ << federation << "\"" ;
- federations.exists(federation.c_str(), num_federation);
+ federations.exists(federation, num_federation);
// Need to dump the fom into that
NM_Join_Federation_Execution rep ;
try
{
num_federe = federations.addFederate(num_federation,
- federate.c_str(),
+ federate,
static_cast<SocketTCP*>(link),
rep);
}
@@ -263,7 +264,7 @@
if (federation.length() == 0) throw RTIinternalError("Invalid Federation
Name.");
- federations.exists(federation.c_str(), num_federation);
+ federations.exists(federation, num_federation);
// May throw RTIinternalError
// FederatesCurrentlyJoined
// FederationExecutionDoesNotExist
@@ -296,7 +297,7 @@
rep.setFederationName(req->getFederationName());
if ( rep.getException() == e_NO_EXCEPTION )
{
- auditServer << "Federation Name \"" << federation.c_str() <<
"\"("<<num_federation<<") destroyed." ;
+ auditServer << "Federation Name \"" << federation <<
"\"("<<num_federation<<") destroyed." ;
}
G.Out(pdGendoc,"processDestroyFederation===>write DFE to RTIA");
@@ -531,31 +532,31 @@
G.Out(pdGendoc,"BEGIN ** REGISTER FEDERATION SYNCHRONIZATION POINT Service
**");
G.Out(pdGendoc,"enter RTIG::processRegisterSynchronization");
- auditServer << "Label \"" << req->getLabel().c_str() << "\" registered.
Tag is \""
- << req->getTag().c_str() << "\"" ;
+ auditServer << "Label \"" << req->getLabel() << "\" registered. Tag is \""
+ << req->getTag() << "\"" ;
// boolean true means a federates set exists
if ( req->doesSetExist() )
federations.manageSynchronization(req->federation,
req->federate,
true,
- req->getLabel().c_str(),
- req->getTag().c_str(),
+ req->getLabel(),
+ req->getTag(),
req->handleArraySize,
req->handleArray);
else
federations.manageSynchronization(req->federation,
req->federate,
true,
- req->getLabel().c_str(),
- req->getTag().c_str());
+ req->getLabel(),
+ req->getTag());
D.Out(pdTerm, "Federation %u is now synchronizing.", req->federation);
// send synchronizationPointRegistrationSucceeded() to federate.
NM_Synchronization_Point_Registration_Succeeded rep ;
rep.federate = req->federate ;
rep.federation = req->federation ;
- rep.setLabel(req->getLabel().c_str());
+ rep.setLabel(req->getLabel());
G.Out(pdGendoc," processRegisterSynchronization====> write SPRS to
RTIA");
@@ -565,15 +566,15 @@
if ( req->doesSetExist() )
federations.broadcastSynchronization(req->federation,
req->federate,
- req->getLabel().c_str(),
- req->getTag().c_str(),
+ req->getLabel(),
+ req->getTag(),
req->handleArraySize,
req->handleArray);
else
federations.broadcastSynchronization(req->federation,
req->federate,
- req->getLabel().c_str(),
- req->getTag().c_str());
+ req->getLabel(),
+ req->getTag());
G.Out(pdGendoc,"exit RTIG::processRegisterSynchronization");
G.Out(pdGendoc,"END ** REGISTER FEDERATION SYNCHRONIZATION POINT Service
**");
@@ -585,12 +586,12 @@
void
RTIG::processSynchronizationAchieved(Socket *, NetworkMessage *req)
{
- auditServer << "Label \"" << req->getLabel().c_str() << "\" ended." ;
+ auditServer << "Label \"" << req->getLabel() << "\" ended." ;
federations.manageSynchronization(req->federation,
req->federate,
false,
- req->getLabel().c_str(),
+ req->getLabel(),
"");
D.Out(pdTerm, "Federate %u has synchronized.", req->federate);
}
@@ -607,11 +608,11 @@
if ( req->isDated() )
// With time
federations.requestFederationSave(req->federation, req->federate,
- req->getLabel().c_str(),
req->getDate());
+ req->getLabel(), req->getDate());
else
// Without time
federations.requestFederationSave(req->federation, req->federate,
- req->getLabel().c_str());
+ req->getLabel());
G.Out(pdGendoc,"exit RTIG::processRequestFederationSave");
G.Out(pdGendoc,"END ** REQUEST FEDERATION SAVE SERVICE **");
@@ -660,7 +661,7 @@
auditServer << "Federate " << req->federate << " request restore." ;
federations.requestFederationRestore(req->federation, req->federate,
- req->getLabel().c_str());
+ req->getLabel());
G.Out(pdGendoc,"exit RTIG::processRequestFederationRestore");
G.Out(pdGendoc,"END ** REQUEST FEDERATION RESTORE SERVICE **");
}
@@ -806,7 +807,7 @@
rep->object = federations.registerObject(req->federation,
req->federate,
req->objectClass,
-
const_cast<char*>(req->getLabel().c_str()));
+ req->getLabel());
auditServer << ", Handle = " << rep->object ;
D.Out(pdRegister,
@@ -847,7 +848,7 @@
ValueArray,
req->handleArraySize,
req->getDate(),
- req->getLabel().c_str());
+ req->getLabel());
}
else
{
@@ -858,7 +859,7 @@
req->handleArray,
ValueArray,
req->handleArraySize,
- req->getLabel().c_str());
+ req->getLabel());
}
ValueArray.empty();
@@ -901,7 +902,7 @@
req->handleArraySize,
req->getDate(),
req->region,
- req->getLabel().c_str());
+ req->getLabel());
}
else
{
@@ -912,7 +913,7 @@
values,
req->handleArraySize,
req->region,
- req->getLabel().c_str());
+ req->getLabel());
}
values.empty();
@@ -948,13 +949,13 @@
req->federate,
req->object,
req->getDate(),
- const_cast<char*>(req->getLabel().c_str()));
+ req->getLabel());
}
else {
federations.destroyObject(req->federation,
req->federate,
req->object,
- const_cast<char*>(req->getLabel().c_str()));
+ req->getLabel());
}
D.Out(pdRegister, "Object # %u of Federation %u has been deleted.",
@@ -1038,7 +1039,7 @@
req->object,
req->handleArray,
req->handleArraySize,
- req->getLabel().c_str());
+ req->getLabel());
D.Out(pdDebug, "Federate %u of Federation %u negotiate "
"divestiture of object %u.",
@@ -1119,7 +1120,7 @@
req->object,
req->handleArray,
req->handleArraySize,
- req->getLabel().c_str());
+ req->getLabel());
D.Out(pdDebug,
"Federate %u of Federation %u ownership acquisition of object %u.",
@@ -1408,7 +1409,7 @@
rep->object = federations.registerObjectWithRegion(req->federation,
req->federate,
req->objectClass,
-
const_cast<char*>(req->getLabel().c_str()),
+ req->getLabel(),
req->region,
req->handleArraySize,
req->handleArray);
@@ -1469,4 +1470,4 @@
}} // namespace certi/rtig
-// $Id: RTIG_processing.cc,v 3.90 2009/11/18 18:50:48 erk Exp $
+// $Id: RTIG_processing.cc,v 3.91 2009/11/19 18:15:29 erk Exp $
Index: RTIG/RTIG.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG.cc,v
retrieving revision 3.59
retrieving revision 3.60
diff -u -b -r3.59 -r3.60
--- RTIG/RTIG.cc 21 Oct 2009 20:04:46 -0000 3.59
+++ RTIG/RTIG.cc 19 Nov 2009 18:15:29 -0000 3.60
@@ -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.59 2009/10/21 20:04:46 erk Exp $
+// $Id: RTIG.cc,v 3.60 2009/11/19 18:15:29 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -35,6 +35,7 @@
#include <iostream>
#include <cerrno>
#include <csignal>
+#include <cstring>
#include <memory>
using std::cout ;
@@ -1035,4 +1036,4 @@
}} // namespace certi/rtig
-// $Id: RTIG.cc,v 3.59 2009/10/21 20:04:46 erk Exp $
+// $Id: RTIG.cc,v 3.60 2009/11/19 18:15:29 erk Exp $
Index: RTIA/Statistics.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/Statistics.cc,v
retrieving revision 3.20
retrieving revision 3.21
diff -u -b -r3.20 -r3.21
--- RTIA/Statistics.cc 18 Nov 2009 18:50:48 -0000 3.20
+++ RTIA/Statistics.cc 19 Nov 2009 18:15:30 -0000 3.21
@@ -340,7 +340,7 @@
int nb = stat.federateServiceSet[i] ;
if (nb > 0 || stat.displayZero()) {
s.width(8);
- s << nb << ' ' << Statistics::fedMessageName[i].c_str() << " (MSG#"
+ s << nb << ' ' << Statistics::fedMessageName[i] << " (MSG#"
<< i << ")" << endl ;
}
sentFederateMessages += nb ;
@@ -355,7 +355,7 @@
int nb = stat.rtiServiceSet[i] ;
if (nb > 0 || stat.displayZero()) {
s.width(8);
- s << nb << ' ' << Statistics::rtiMessageName[i].c_str() << " (MSG#"
+ s << nb << ' ' << Statistics::rtiMessageName[i] << " (MSG#"
<< i << ")" << endl ;
}
sentRtiMessages += nb ;
@@ -373,4 +373,4 @@
#undef FED_MSG_NAME
#undef RTI_MSG_NAME
-// $Id: Statistics.cc,v 3.20 2009/11/18 18:50:48 erk Exp $
+// $Id: Statistics.cc,v 3.21 2009/11/19 18:15:30 erk Exp $
Index: RTIA/OwnershipManagement.hh
===================================================================
RCS file: /sources/certi/certi/RTIA/OwnershipManagement.hh,v
retrieving revision 3.8
retrieving revision 3.9
diff -u -b -r3.8 -r3.9
--- RTIA/OwnershipManagement.hh 10 Jun 2008 13:41:44 -0000 3.8
+++ RTIA/OwnershipManagement.hh 19 Nov 2009 18:15:30 -0000 3.9
@@ -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: OwnershipManagement.hh,v 3.8 2008/06/10 13:41:44 rousse Exp $
+// $Id: OwnershipManagement.hh,v 3.9 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIA_OWM
@@ -74,7 +74,7 @@
negotiatedAttributeOwnershipDivestiture(ObjectHandle theObject,
std::vector <AttributeHandle>
&attribArray,
UShort attribArraySize,
- std::string theTag,
+ const std::string& theTag,
TypeException &e);
void
cancelnegotiatedAttributeOwnershipDivestiture(ObjectHandle theObject,
@@ -112,7 +112,7 @@
std::vector <AttributeHandle>
&attribArray,
UShort attribArraySize,
FederateHandle theOwner,
- std::string theTag,
+ const std::string& theTag,
TypeException &e);
void
@@ -125,14 +125,14 @@
attributeOwnershipAcquisition(ObjectHandle theObject,
std::vector <AttributeHandle> &attribArray,
UShort attribArraySize,
- std::string theTag,
+ const std::string& theTag,
TypeException &e);
void
requestAttributeOwnershipRelease(ObjectHandle theObject,
std::vector <AttributeHandle>
&attribArray,
UShort attribArraySize,
- std::string theTag,
+ const std::string& theTag,
TypeException &e);
void
@@ -162,4 +162,4 @@
#endif // _CERTI_RTIA_OWM
-// $Id: OwnershipManagement.hh,v 3.8 2008/06/10 13:41:44 rousse Exp $
+// $Id: OwnershipManagement.hh,v 3.9 2009/11/19 18:15:30 erk Exp $
Index: RTIA/FederationManagement.hh
===================================================================
RCS file: /sources/certi/certi/RTIA/FederationManagement.hh,v
retrieving revision 3.26
retrieving revision 3.27
diff -u -b -r3.26 -r3.27
--- RTIA/FederationManagement.hh 18 Nov 2009 18:50:48 -0000 3.26
+++ RTIA/FederationManagement.hh 19 Nov 2009 18:15:30 -0000 3.27
@@ -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: FederationManagement.hh,v 3.26 2009/11/18 18:50:48 erk Exp $
+// $Id: FederationManagement.hh,v 3.27 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIA_FEDERATION_MANAGEMENT
@@ -52,11 +52,11 @@
throw ( FederationExecutionAlreadyExists,
CouldNotOpenFED,ErrorReadingFED,
RTIinternalError);
- void destroyFederationExecution(std::string theName, TypeException &e);
+ void destroyFederationExecution(const std::string& theName, TypeException
&e);
// -- Join/Resign --
- FederateHandle joinFederationExecution(std::string Federate,
- std::string Federation,
+ FederateHandle joinFederationExecution(const std::string& Federate,
+ const std::string& Federation,
RootObject* rootObject,
TypeException &e);
@@ -65,39 +65,39 @@
void resignFederationExecutionForTermination();
// Synchronization.
- void registerSynchronization(std::string label,
- std::string tag,
+ void registerSynchronization(const std::string& label,
+ const std::string& tag,
TypeException &e);
- void registerSynchronization(std::string label,
- std::string tag,
+ void registerSynchronization(const std::string& label,
+ const std::string& tag,
unsigned short array_size,
std::vector <FederateHandle> &fed_array,
TypeException &e);
- void unregisterSynchronization(std::string label,
+ void unregisterSynchronization(const std::string& label,
TypeException &e);
- void synchronizationPointRegistrationFailed(const char *label);
- void synchronizationPointRegistrationSucceeded(const char *label);
- void federationSynchronized(const char *label);
- void announceSynchronizationPoint(const char *label,
- const char *tag);
+ void synchronizationPointRegistrationFailed(const std::string& label);
+ void synchronizationPointRegistrationSucceeded(const std::string& label);
+ void federationSynchronized(const std::string& label);
+ void announceSynchronizationPoint(const std::string& label,
+ const std::string& tag);
// Saving.
- void requestFederationSave(std::string label, FederationTime the_time,
TypeException &e);
- void requestFederationSave(std::string label, TypeException &e);
+ void requestFederationSave(const std::string& label, FederationTime
the_time, TypeException &e);
+ void requestFederationSave(const std::string& label, TypeException &e);
void federateSaveBegun(TypeException &);
void federateSaveStatus(bool, TypeException &);
- void initiateFederateSave(const char *label);
+ void initiateFederateSave(const std::string& label);
void federationSavedStatus(bool);
// Restoring.
- void requestFederationRestore(std::string label,
+ void requestFederationRestore(const std::string& label,
TypeException &e);
void federateRestoreStatus(bool status, TypeException &e);
void requestFederationRestoreStatus(bool status,
- const char *label,
- const char *reason);
+ const std::string& label,
+ const std::string& reason);
void federationRestoreBegun(void);
- void initiateFederateRestore(const char *label,
+ void initiateFederateRestore(const std::string& label,
FederateHandle handle);
void federationRestoredStatus(bool status);
@@ -117,7 +117,7 @@
bool savingState ;
bool restoringState ;
- std::list<char *> synchronizationLabels ; //!< Labels being synchronized.
+ std::list<std::string> synchronizationLabels ; //!< Labels being
synchronized.
std::string _nom_federation ;
std::string _nom_federe;
@@ -128,4 +128,4 @@
#endif // _CERTI_RTIA_FEDERATION_MANAGEMENT
-// $Id: FederationManagement.hh,v 3.26 2009/11/18 18:50:48 erk Exp $
+// $Id: FederationManagement.hh,v 3.27 2009/11/19 18:15:30 erk Exp $
Index: RTIA/ObjectManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/ObjectManagement.cc,v
retrieving revision 3.61
retrieving revision 3.62
diff -u -b -r3.61 -r3.62
--- RTIA/ObjectManagement.cc 14 Sep 2009 21:21:32 -0000 3.61
+++ RTIA/ObjectManagement.cc 19 Nov 2009 18:15:30 -0000 3.62
@@ -44,7 +44,6 @@
#endif
using std::cout ;
using std::endl ;
-using std::string ;
namespace certi {
namespace rtia {
@@ -55,15 +54,13 @@
const ObjectManagement::TransportTypeList
ObjectManagement::transportTypeList[] = {
{ "HLAreliable", RELIABLE },
- { "HLAbestEffort", BEST_EFFORT },
- { NULL }
+ { "HLAbestEffort", BEST_EFFORT }
};
const ObjectManagement::OrderTypeList
ObjectManagement::orderTypeList[] = {
{ "Receive", RECEIVE },
- { "Timestamp", TIMESTAMP },
- { NULL }
+ { "Timestamp", TIMESTAMP }
};
ObjectManagement::ObjectManagement(Communications *GC,
@@ -80,7 +77,7 @@
//! registerObject
ObjectHandle
ObjectManagement::registerObject(ObjectClassHandle the_class,
- const char *theObjectName,
+ const std::string& theObjectName,
FederationTime,
FederationTime,
TypeException & e)
@@ -100,7 +97,7 @@
if (e == e_NO_EXCEPTION) {
rootObject->registerObjectInstance(fm->federate, the_class,
rep->object,
- rep->getLabel().c_str());
+ rep->getLabel());
return rep->object ;
}
else {
@@ -125,7 +122,7 @@
std::vector<AttributeValue_t>
&valueArray,
UShort attribArraySize,
FederationTime theTime,
- std::string theTag,
+ const std::string& theTag,
TypeException &e)
{
NM_Update_Attribute_Values req;
@@ -190,7 +187,7 @@
std::vector<AttributeHandle>
&attribArray,
std::vector<AttributeValue_t>
&valueArray,
UShort attribArraySize,
- std::string theTag,
+ const std::string& theTag,
TypeException &e)
{
NM_Update_Attribute_Values req;
@@ -225,7 +222,7 @@
void
ObjectManagement::discoverObject(ObjectHandle the_object,
ObjectClassHandle the_class,
- const char *the_name,
+ const std::string& the_name,
FederationTime the_time,
EventRetractionHandle the_event,
TypeException &)
@@ -254,7 +251,7 @@
try {
// Adding discovered object in federate internal object list.
rootObject->registerObjectInstance(fm->federate, the_class, the_object,
- req.getName().c_str());
+ req.getName());
}
catch (ObjectAlreadyRegistered) {
}
@@ -268,7 +265,7 @@
std::vector <AttributeValue_t>
&the_values,
UShort the_size,
FederationTime the_time,
- const char *the_tag,
+ const std::string& the_tag,
EventRetractionHandle the_event,
TypeException &)
{
@@ -295,7 +292,7 @@
std::vector <AttributeHandle>
&the_attributes,
std::vector <AttributeValue_t>
&the_values,
UShort the_size,
- const char *the_tag,
+ const std::string& the_tag,
TypeException &)
{
Message req;
@@ -320,7 +317,7 @@
std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
FederationTime theTime,
- std::string theTag,
+ const std::string& theTag,
RegionHandle region,
TypeException &e)
{
@@ -377,7 +374,7 @@
std::vector <ParameterHandle> ¶mArray,
std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
- std::string theTag,
+ const std::string& theTag,
RegionHandle region,
TypeException &e)
{
@@ -421,7 +418,7 @@
std::vector <ParameterValue_t>
&the_values,
UShort the_size,
FederationTime the_time,
- const char *the_tag,
+ const std::string& the_tag,
EventRetractionHandle the_event,
TypeException &)
{
@@ -444,7 +441,7 @@
std::vector <ParameterHandle>
&the_parameters,
std::vector <ParameterValue_t>
&the_values,
UShort the_size,
- const char *the_tag,
+ const std::string& the_tag,
TypeException &)
{
Message req;
@@ -462,7 +459,7 @@
EventRetractionHandle
ObjectManagement::deleteObject(ObjectHandle theObjectHandle,
FederationTime theTime,
- std::string theTag,
+ const std::string& theTag,
TypeException &e)
{
NM_Delete_Object req;
@@ -489,7 +486,7 @@
//! deleteObject without time
void
ObjectManagement::deleteObject(ObjectHandle theObjectHandle,
- std::string theTag,
+ const std::string& theTag,
TypeException &e)
{
NM_Delete_Object req;
@@ -515,7 +512,7 @@
ObjectManagement::removeObject(ObjectHandle the_object,
FederateHandle the_federate,
FederationTime theTime,
- const char *the_tag,
+ const std::string& the_tag,
EventRetractionHandle the_event,
TypeException &)
@@ -539,7 +536,7 @@
void
ObjectManagement::removeObject(ObjectHandle the_object,
FederateHandle the_federate,
- const char *the_tag,
+ const std::string& the_tag,
TypeException &)
{
Message req;
@@ -743,7 +740,7 @@
// ----------------------------------------------------------------------------
//! getObjectClassHandle.
ObjectClassHandle
-ObjectManagement::getObjectClassHandle(const char *theName)
+ObjectManagement::getObjectClassHandle(const std::string& theName)
{
ObjectClassHandle handle ;
G.Out(pdGendoc,"enter ObjectManagement::getObjectClassHandle");
@@ -761,7 +758,7 @@
// ----------------------------------------------------------------------------
//! getObjectClassName.
-string
+const std::string&
ObjectManagement::getObjectClassName(ObjectClassHandle theHandle)
{
return rootObject->ObjectClasses->getObjectClassName(theHandle);
@@ -770,14 +767,14 @@
// ----------------------------------------------------------------------------
//! Returns the object instance handle.
ObjectHandle
-ObjectManagement::getObjectInstanceHandle(const char *the_name)
+ObjectManagement::getObjectInstanceHandle(const std::string& the_name)
{
return rootObject->objects->getObjectInstanceHandle(the_name);
}
// ----------------------------------------------------------------------------
//! Returns the object instance name.
-const char *
+const std::string&
ObjectManagement::getObjectInstanceName(ObjectHandle the_object)
{
return rootObject->objects->getObjectInstanceName(the_object);
@@ -786,7 +783,7 @@
// ----------------------------------------------------------------------------
//! getAttributeHandle.
AttributeHandle
-ObjectManagement::getAttributeHandle(const char *theName,
+ObjectManagement::getAttributeHandle(const std::string& theName,
ObjectClassHandle theClassHandle)
{
AttributeHandle handle ;
@@ -805,7 +802,7 @@
// ----------------------------------------------------------------------------
//! getAttributeName.
-const char *
+const std::string&
ObjectManagement::getAttributeName(AttributeHandle theHandle,
ObjectClassHandle theClassHandle)
{
@@ -816,14 +813,14 @@
// ----------------------------------------------------------------------------
//! getInteractionClassHandle.
InteractionClassHandle
-ObjectManagement::getInteractionClassHandle(const char *theName)
+ObjectManagement::getInteractionClassHandle(const std::string& theName)
{
return rootObject->Interactions->getInteractionClassHandle(theName);
}
// ----------------------------------------------------------------------------
//! getInteractionClassName.
-const std::string
+const std::string&
ObjectManagement::
getInteractionClassName(InteractionClassHandle theClassHandle)
{
@@ -834,7 +831,7 @@
// ----------------------------------------------------------------------------
//! getParameterHandle.
ParameterHandle
-ObjectManagement::getParameterHandle(const char *theParameterName,
+ObjectManagement::getParameterHandle(const std::string& theParameterName,
InteractionClassHandle theClassHandle)
{
return rootObject->Interactions->getParameterHandle(theParameterName,
@@ -862,11 +859,11 @@
// ----------------------------------------------------------------------------
//! getTransportationHandle
TransportType
-ObjectManagement::getTransportationHandle(const char *theName)
+ObjectManagement::getTransportationHandle(const std::string& theName)
{
- for(const TransportTypeList *item = transportTypeList; item->name != NULL;
item++) {
- if(strcmp(theName, item->name) == 0)
- return item->type;
+ for(unsigned i = 0; i <
sizeof(transportTypeList)/sizeof(transportTypeList[0]); ++i) {
+ if(theName == transportTypeList[i].name)
+ return transportTypeList[i].type;
}
throw NameNotFound(theName);
@@ -874,12 +871,12 @@
// ----------------------------------------------------------------------------
//! getTransportationName
-const char *
+const std::string&
ObjectManagement::getTransportationName(TransportType theType)
{
- for(const TransportTypeList *item = transportTypeList; item->name != NULL;
item++) {
- if(theType == item->type)
- return item->name;
+ for(unsigned i = 0; i <
sizeof(transportTypeList)/sizeof(transportTypeList[0]); ++i) {
+ if(theType == transportTypeList[i].type)
+ return transportTypeList[i].name;
}
throw InvalidTransportationHandle("");
@@ -888,11 +885,11 @@
// ----------------------------------------------------------------------------
//! getOrderingHandle
OrderType
-ObjectManagement::getOrderingHandle(const char *theName)
+ObjectManagement::getOrderingHandle(const std::string& theName)
{
- for(const OrderTypeList *item = orderTypeList; item->name != NULL; item++)
{
- if(strcmp(theName, item->name) == 0)
- return item->type;
+ for(unsigned i = 0; i < sizeof(orderTypeList)/sizeof(orderTypeList[0]);
++i) {
+ if(theName == orderTypeList[i].name)
+ return orderTypeList[i].type;
}
throw NameNotFound(theName);
@@ -900,12 +897,12 @@
// ----------------------------------------------------------------------------
//! getOrderingName
-const char *
+const std::string&
ObjectManagement::getOrderingName(OrderType theType)
{
- for(const OrderTypeList *item = orderTypeList; item->name != NULL; item++)
{
- if(theType == item->type)
- return item->name;
+ for(unsigned i = 0; i < sizeof(orderTypeList)/sizeof(orderTypeList[0]);
++i) {
+ if(theType == orderTypeList[i].type)
+ return orderTypeList[i].name;
}
throw InvalidOrderingHandle("");
Index: RTIA/RTIA_federate.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_federate.cc,v
retrieving revision 3.101
retrieving revision 3.102
diff -u -b -r3.101 -r3.102
--- RTIA/RTIA_federate.cc 18 Nov 2009 18:50:48 -0000 3.101
+++ RTIA/RTIA_federate.cc 19 Nov 2009 18:15:30 -0000 3.102
@@ -329,7 +329,7 @@
"Receiving Message from Federate, type RegisterObject.");
rep.setObject(om->registerObject(req->getObjectClass(),
- req->getName().c_str(),
+ req->getName(),
date, heure, e));
break ;
}
@@ -699,7 +699,7 @@
D.Out(pdTrace,
"Receiving Message from Federate, type GetObjectClassHandle.");
try {
-
rep.setObjectClass(om->getObjectClassHandle(req->getName().c_str()));
+ rep.setObjectClass(om->getObjectClassHandle(req->getName()));
}
catch (Exception &egoch)
{
@@ -712,7 +712,7 @@
"Receiving Message from Federate, type GetObjectClassName.");
try {
- rep.setName(om->getObjectClassName(req->getObjectClass()).c_str());
+ rep.setName(om->getObjectClassName(req->getObjectClass()));
}
catch (ObjectClassNotDefined) {
rep.setException(e_ObjectClassNotDefined);
@@ -725,7 +725,7 @@
case Message::GET_OBJECT_INSTANCE_HANDLE:
D.Out(pdTrace,
"Receiving Message from Federate, type
getObjectInstanceHandle.");
- rep.setObject(om->getObjectInstanceHandle(req->getName().c_str()));
+ rep.setObject(om->getObjectInstanceHandle(req->getName()));
break ;
case Message::GET_OBJECT_INSTANCE_NAME:
@@ -741,7 +741,7 @@
D.Out(pdTrace,
"Receiving Message from Federate, type GetAttributeHandle.");
try {
- rep.setAttribute(om->getAttributeHandle(req->getName().c_str(),
+ rep.setAttribute(om->getAttributeHandle(req->getName(),
req->getObjectClass()));
}
catch (Exception &egah)
@@ -762,21 +762,21 @@
D.Out(pdTrace,
"Receiving Message from Federate, type GetInteractionHandle.");
-
rep.setInteractionClass(om->getInteractionClassHandle(req->getName().c_str()));
+ rep.setInteractionClass(om->getInteractionClassHandle(req->getName()));
break ;
case Message::GET_INTERACTION_CLASS_NAME:
D.Out(pdTrace,
"Receiving Message from Federate, type GetInteractionName.");
-
rep.setName(om->getInteractionClassName(req->getInteractionClass()).c_str());
+ rep.setName(om->getInteractionClassName(req->getInteractionClass()));
break ;
case Message::GET_PARAMETER_HANDLE:
D.Out(pdTrace,
"Receiving Message from Federate, type GetParameterHandle.");
- rep.setParameter(om->getParameterHandle(req->getName().c_str(),
+ rep.setParameter(om->getParameterHandle(req->getName(),
req->getInteractionClass()));
break ;
@@ -785,7 +785,7 @@
"Receiving Message from Federate, type GetParameterName.");
rep.setName(om->getParameterName(req->getParameter(),
- req->getInteractionClass()).c_str());
+ req->getInteractionClass()));
break ;
case Message::GET_SPACE_HANDLE:
@@ -795,7 +795,7 @@
case Message::GET_SPACE_NAME:
D.Out(pdTrace, "Receiving Message from Federate, type GetSpaceName.");
- rep.setName(ddm->getRoutingSpaceName(req->getSpace()).c_str());
+ rep.setName(ddm->getRoutingSpaceName(req->getSpace()));
break ;
case Message::GET_DIMENSION_HANDLE:
@@ -809,7 +809,7 @@
D.Out(pdTrace,
"Receiving Message from Federate, type GetDimensionName");
rep.setName(ddm->getDimensionName(req->getDimension(),
- req->getSpace()).c_str());
+ req->getSpace()));
break ;
case Message::GET_ATTRIBUTE_SPACE_HANDLE:
@@ -832,7 +832,7 @@
case Message::GET_TRANSPORTATION_HANDLE:
Debug(D, pdTrace) << "Message from Federate: getTransportationHandle"
<< endl ;
-
rep.setTransportation(om->getTransportationHandle(req->getName().c_str()));
+ rep.setTransportation(om->getTransportationHandle(req->getName()));
break ;
case Message::GET_TRANSPORTATION_NAME:
@@ -842,7 +842,7 @@
case Message::GET_ORDERING_HANDLE:
Debug(D, pdTrace) << "Message from Federate: getOrderingHandle" <<
endl ;
- rep.setOrdering(om->getOrderingHandle(req->getName().c_str()));
+ rep.setOrdering(om->getOrderingHandle(req->getName()));
break ;
case Message::GET_ORDERING_NAME:
Index: RTIA/DataDistribution.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/DataDistribution.cc,v
retrieving revision 3.30
retrieving revision 3.31
diff -u -b -r3.30 -r3.31
--- RTIA/DataDistribution.cc 21 Oct 2009 20:04:47 -0000 3.30
+++ RTIA/DataDistribution.cc 19 Nov 2009 18:15:30 -0000 3.31
@@ -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: DataDistribution.cc,v 3.30 2009/10/21 20:04:47 erk Exp $
+// $Id: DataDistribution.cc,v 3.31 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -38,7 +38,6 @@
#include <cassert>
#include <memory>
-using std::string ;
using std::endl ;
namespace certi {
@@ -56,7 +55,7 @@
// ----------------------------------------------------------------------------
SpaceHandle
-DataDistribution::getRoutingSpaceHandle(std::string name) const
+DataDistribution::getRoutingSpaceHandle(const std::string& name) const
{
return rootObject->getRoutingSpaceHandle(name);
}
@@ -64,7 +63,7 @@
// ----------------------------------------------------------------------------
// getRoutingSpaceName
//
-string
+const std::string&
DataDistribution::getRoutingSpaceName(SpaceHandle handle) const
{
return rootObject->getRoutingSpaceName(handle);
@@ -74,7 +73,7 @@
// getDimensionHandle
//
DimensionHandle
-DataDistribution::getDimensionHandle(std::string dimension, SpaceHandle space)
const
+DataDistribution::getDimensionHandle(const std::string& dimension, SpaceHandle
space) const
throw (SpaceNotDefined, NameNotFound)
{
return rootObject->getRoutingSpace(space).getDimensionHandle(dimension);
@@ -83,7 +82,7 @@
// ----------------------------------------------------------------------------
// getDimensionName
//
-string
+const std::string&
DataDistribution::getDimensionName(DimensionHandle dimension,
SpaceHandle space) const
throw (SpaceNotDefined, DimensionNotDefined)
@@ -249,7 +248,7 @@
// ----------------------------------------------------------------------------
ObjectHandle
DataDistribution::registerObject(ObjectClassHandle class_handle,
- const std::string name,
+ const std::string& name,
const std::vector <AttributeHandle> &attrs,
int nb,
const std::vector<RegionHandle> regions,
@@ -263,7 +262,7 @@
req.federation = fm->_numero_federation ;
req.federate = fm->federate ;
req.objectClass = class_handle ;
- req.setTag(name.c_str());
+ req.setTag(name);
req.setAHS(attrs, nb);
req.setRegions(regions);
@@ -274,7 +273,7 @@
if (e == e_NO_EXCEPTION) {
rootObject->registerObjectInstance(fm->federate, class_handle,
rep->object,
- rep->getLabel().c_str());
+ rep->getLabel());
for (int i = 0 ; i < nb ; ++i) {
Debug(D, pdDebug) << "Register attribute [" << i << "] Attr: " <<
attrs[i]
<< " Region: " << regions[i] << std::endl ;
@@ -413,4 +412,4 @@
}} // namespace certi::rtia
-// $Id: DataDistribution.cc,v 3.30 2009/10/21 20:04:47 erk Exp $
+// $Id: DataDistribution.cc,v 3.31 2009/11/19 18:15:30 erk Exp $
Index: RTIA/TimeManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/TimeManagement.cc,v
retrieving revision 3.51
retrieving revision 3.52
diff -u -b -r3.51 -r3.52
--- RTIA/TimeManagement.cc 4 Oct 2009 15:46:39 -0000 3.51
+++ RTIA/TimeManagement.cc 19 Nov 2009 18:15:30 -0000 3.52
@@ -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: TimeManagement.cc,v 3.51 2009/10/04 15:46:39 erk Exp $
+// $Id: TimeManagement.cc,v 3.52 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -132,7 +132,7 @@
case NetworkMessage::FEDERATION_SYNCHRONIZED:
try {
- fm->federationSynchronized(msg.getLabel().c_str());
+ fm->federationSynchronized(msg.getLabel());
}
catch (RTIinternalError &e) {
cout << "RTIA:RTIinternalError in federationSynchronized." << endl
;
@@ -142,7 +142,7 @@
case NetworkMessage::SYNCHRONIZATION_POINT_REGISTRATION_SUCCEEDED:
try {
-
fm->synchronizationPointRegistrationSucceeded(msg.getLabel().c_str());
+ fm->synchronizationPointRegistrationSucceeded(msg.getLabel());
}
catch (RTIinternalError &e) {
cout << "RTIA:RTIinternalError in synchronizationPointRegistration"
@@ -153,7 +153,7 @@
case NetworkMessage::ANNOUNCE_SYNCHRONIZATION_POINT:
try {
- fm->announceSynchronizationPoint(msg.getLabel().c_str(),
msg.getTag().c_str());
+ fm->announceSynchronizationPoint(msg.getLabel(), msg.getTag());
}
catch (RTIinternalError &e) {
cout << "RTIA:RTIinternalError in announceSynchronizationPoint."
<< endl ;
@@ -165,7 +165,7 @@
try {
om->discoverObject(msg.object,
msg.objectClass,
- msg.getLabel().c_str(),
+ msg.getLabel(),
msg.getDate(),
msg.eventRetraction,
msg.getRefException());
@@ -187,7 +187,7 @@
ValueArray,
msg.handleArraySize,
msg.getDate(),
- msg.getLabel().c_str(),
+ msg.getLabel(),
msg.eventRetraction,
msg.getRefException());
else
@@ -195,7 +195,7 @@
msg.handleArray,
ValueArray,
msg.handleArraySize,
- msg.getLabel().c_str(),
+ msg.getLabel(),
msg.getRefException());
ValueArray.empty();
break ;
@@ -221,7 +221,7 @@
ValueArray,
msg.handleArraySize,
msg.getDate(),
- msg.getLabel().c_str(),
+ msg.getLabel(),
msg.eventRetraction,
msg.getRefException());
else
@@ -229,7 +229,7 @@
msg.handleArray,
ValueArray,
msg.handleArraySize,
- msg.getLabel().c_str(),
+ msg.getLabel(),
msg.getRefException());
ValueArray.empty();
@@ -241,14 +241,14 @@
om->removeObject(msg.object,
msg.federate,
msg.getDate(),
- msg.getLabel().c_str(),
+ msg.getLabel(),
msg.eventRetraction,
msg.getRefException());
}
else {
om->removeObject(msg.object,
msg.federate,
- msg.getLabel().c_str(),
+ msg.getLabel(),
msg.getRefException());
}
break ;
@@ -276,7 +276,7 @@
msg.handleArray,
msg.handleArraySize,
msg.federate,
-
const_cast<char*>(msg.getLabel().c_str()),
+ msg.getLabel(),
msg.getRefException());
break ;
}
@@ -315,7 +315,7 @@
owm->requestAttributeOwnershipRelease(msg.object,
msg.handleArray,
msg.handleArraySize,
-
const_cast<char*>(msg.getLabel().c_str()),
+ msg.getLabel(),
msg.getRefException());
break ;
}
@@ -330,7 +330,7 @@
}
case NetworkMessage::INITIATE_FEDERATE_SAVE:
- fm->initiateFederateSave(msg.getLabel().c_str());
+ fm->initiateFederateSave(msg.getLabel());
break ;
case NetworkMessage::FEDERATION_SAVED:
@@ -344,7 +344,7 @@
case NetworkMessage::REQUEST_FEDERATION_RESTORE_FAILED: {
bool status = (msg.getType() ==
NetworkMessage::REQUEST_FEDERATION_RESTORE_SUCCEEDED)
? true : false ;
- fm->requestFederationRestoreStatus(status, msg.getLabel().c_str(),
msg.getTag().c_str());
+ fm->requestFederationRestoreStatus(status, msg.getLabel(),
msg.getTag());
}
break ;
@@ -353,7 +353,7 @@
break ;
case NetworkMessage::INITIATE_FEDERATE_RESTORE:
- fm->initiateFederateRestore(msg.getLabel().c_str(), msg.federate);
+ fm->initiateFederateRestore(msg.getLabel(), msg.federate);
break ;
case NetworkMessage::FEDERATION_RESTORED:
@@ -376,7 +376,7 @@
std::stringstream errorMsg;
D.Out(pdExcept, "Unknown message type in executeFederateService.");
errorMsg << "Unknown message <" << msg.getName() << " in
executeFederateService.";
- throw RTIinternalError(errorMsg.str().c_str());
+ throw RTIinternalError(errorMsg.str());
}
G.Out(pdGendoc,"exit TimeManagement::executeFederateService");
return true ;
@@ -1001,4 +1001,4 @@
}} // namespaces
-// $Id: TimeManagement.cc,v 3.51 2009/10/04 15:46:39 erk Exp $
+// $Id: TimeManagement.cc,v 3.52 2009/11/19 18:15:30 erk Exp $
Index: RTIA/ObjectManagement.hh
===================================================================
RCS file: /sources/certi/certi/RTIA/ObjectManagement.hh,v
retrieving revision 3.30
retrieving revision 3.31
diff -u -b -r3.30 -r3.31
--- RTIA/ObjectManagement.hh 21 Nov 2008 13:41:52 -0000 3.30
+++ RTIA/ObjectManagement.hh 19 Nov 2009 18:15:30 -0000 3.31
@@ -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: ObjectManagement.hh,v 3.30 2008/11/21 13:41:52 approx Exp $
+// $Id: ObjectManagement.hh,v 3.31 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIA_OM
@@ -26,9 +26,6 @@
#include "RootObject.hh"
-#define IDRESERVED 4294000000
-#define NOTLINKED -1
-
namespace certi {
namespace rtia {
@@ -46,7 +43,7 @@
// Object Management services
ObjectHandle registerObject(ObjectClassHandle theClassHandle,
- const char *theObjectName,
+ const std::string& theObjectName,
FederationTime date,
FederationTime heure,
TypeException &e);
@@ -57,19 +54,19 @@
std::vector<AttributeValue_t> &valueArray,
UShort attribArraySize,
FederationTime theTime,
- std::string theTag,
+ const std::string& theTag,
TypeException &e);
void updateAttributeValues(ObjectHandle theObjectHandle,
std::vector<AttributeHandle> &attribArray,
std::vector<AttributeValue_t> &valueArray,
UShort attribArraySize,
- std::string theTag,
+ const std::string& theTag,
TypeException &e);
void discoverObject(ObjectHandle theObjectHandle,
ObjectClassHandle theObjectClassHandle,
- const char *theObjectName,
+ const std::string& theObjectName,
FederationTime theTime,
EventRetractionHandle theHandle,
TypeException &e);
@@ -79,7 +76,7 @@
std::vector <AttributeValue_t> &valueArray,
UShort attribArraySize,
FederationTime theTime,
- const char *theTag,
+ const std::string& theTag,
EventRetractionHandle theHandle,
TypeException &e);
@@ -87,7 +84,7 @@
std::vector <AttributeHandle> &attribArray,
std::vector <AttributeValue_t> &valueArray,
UShort attribArraySize,
- const char *theTag,
+ const std::string& theTag,
TypeException &e);
EventRetractionHandle
@@ -96,7 +93,7 @@
std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
FederationTime theTime,
- std::string theTag,
+ const std::string& theTag,
RegionHandle,
TypeException &e);
@@ -105,7 +102,7 @@
std::vector <ParameterHandle> ¶mArray,
std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
- std::string theTag,
+ const std::string& theTag,
RegionHandle,
TypeException &e);
@@ -114,7 +111,7 @@
std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
FederationTime theTime,
- const char *theTag,
+ const std::string& theTag,
EventRetractionHandle theHandle,
TypeException &e);
@@ -122,28 +119,28 @@
std::vector <ParameterHandle> ¶mArray,
std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
- const char *theTag,
+ const std::string& theTag,
TypeException &e);
EventRetractionHandle deleteObject(ObjectHandle theObjectHandle,
FederationTime theTime,
- std::string theTag,
+ const std::string& theTag,
TypeException &e);
void deleteObject(ObjectHandle theObjectHandle,
- std::string theTag,
+ const std::string& theTag,
TypeException &e);
void removeObject(ObjectHandle theObjectHandle,
FederateHandle theFederateHandle,
FederationTime theTime,
- const char *theTag,
+ const std::string& theTag,
EventRetractionHandle theHandle,
TypeException &e);
void removeObject(ObjectHandle theObjectHandle,
FederateHandle theFederateHandle,
- const char *theTag,
+ const std::string& theTag,
TypeException &e);
void removeObject(ObjectHandle theObject,
@@ -245,23 +242,23 @@
TypeException &e);
// RTI Support Services
- ObjectClassHandle getObjectClassHandle(const char *theName);
- std::string getObjectClassName(ObjectClassHandle);
+ ObjectClassHandle getObjectClassHandle(const std::string& theName);
+ const std::string& getObjectClassName(ObjectClassHandle);
- ObjectHandle getObjectInstanceHandle(const char *);
- const char *getObjectInstanceName(ObjectHandle);
+ ObjectHandle getObjectInstanceHandle(const std::string&);
+ const std::string& getObjectInstanceName(ObjectHandle);
- AttributeHandle getAttributeHandle(const char *theName,
+ AttributeHandle getAttributeHandle(const std::string& theName,
ObjectClassHandle theClassHandle);
- const char *getAttributeName(AttributeHandle theHandle,
+ const std::string& getAttributeName(AttributeHandle theHandle,
ObjectClassHandle theClassHandle);
- InteractionClassHandle getInteractionClassHandle(const char *theName);
+ InteractionClassHandle getInteractionClassHandle(const std::string&
theName);
- const std::string getInteractionClassName(InteractionClassHandle
theClassHandle);
+ const std::string& getInteractionClassName(InteractionClassHandle
theClassHandle);
- ParameterHandle getParameterHandle(const char *theParameterName,
+ ParameterHandle getParameterHandle(const std::string& theParameterName,
InteractionClassHandle theClassHandle);
const std::string& getParameterName(ParameterHandle theParameterHandle,
@@ -269,11 +266,11 @@
ObjectClassHandle getObjectClass(ObjectHandle);
- TransportType getTransportationHandle(const char *theName);
- const char *getTransportationName(TransportType theType);
+ TransportType getTransportationHandle(const std::string& theName);
+ const std::string& getTransportationName(TransportType theType);
- OrderType getOrderingHandle(const char *theName);
- const char *getOrderingName(OrderType theType);
+ OrderType getOrderingHandle(const std::string& theName);
+ const std::string& getOrderingName(OrderType theType);
TimeManagement *tm ;
@@ -285,13 +282,13 @@
private:
struct TransportTypeList {
- const char *name;
+ std::string name;
TransportType type;
};
static const TransportTypeList transportTypeList[];
struct OrderTypeList {
- const char *name;
+ std::string name;
OrderType type;
};
static const OrderTypeList orderTypeList[];
@@ -301,4 +298,4 @@
#endif // _CERTI_RTIA_OM
-// $Id: ObjectManagement.hh,v 3.30 2008/11/21 13:41:52 approx Exp $
+// $Id: ObjectManagement.hh,v 3.31 2009/11/19 18:15:30 erk Exp $
Index: RTIA/FederationManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/FederationManagement.cc,v
retrieving revision 3.76
retrieving revision 3.77
diff -u -b -r3.76 -r3.77
--- RTIA/FederationManagement.cc 18 Nov 2009 18:50:48 -0000 3.76
+++ RTIA/FederationManagement.cc 19 Nov 2009 18:15:30 -0000 3.77
@@ -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: FederationManagement.cc,v 3.76 2009/11/18 18:50:48 erk Exp $
+// $Id: FederationManagement.cc,v 3.77 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -32,6 +32,7 @@
#include <windows.h>
#else
#include <list>
+#include <cstring>
#include <cstdio>
#include <sys/types.h>
#include <sys/stat.h>
@@ -42,7 +43,6 @@
#include <memory>
using std::list ;
-using std::string ;
namespace certi {
namespace rtia {
@@ -140,7 +140,7 @@
if (reponse->getException() == e_NO_EXCEPTION)
{
- _nom_federation = std::string(theName);
+ _nom_federation = theName;
_numero_federation = reponse->federation ;
D.Out(pdInit, "est createur");
}
@@ -150,28 +150,28 @@
e = reponse->getException();
G.Out(pdGendoc,"exit FederationManagement::"
"createFederationExecution on exception");
- throw CouldNotOpenFED (reponse->exceptionReason.c_str()) ;
+ throw CouldNotOpenFED (reponse->exceptionReason) ;
}
else if (reponse->getException() == e_FederationExecutionAlreadyExists)
{
e = reponse->getException();
G.Out(pdGendoc,"exit FederationManagement::"
"createFederationExecution on exception");
- throw FederationExecutionAlreadyExists
(reponse->exceptionReason.c_str()) ;
+ throw FederationExecutionAlreadyExists (reponse->exceptionReason) ;
}
else if (reponse->getException() == e_ErrorReadingFED)
{
e = reponse->getException();
G.Out(pdGendoc,"exit FederationManagement::"
"createFederationExecution on exception
ErrorReadingFED");
- throw ErrorReadingFED (reponse->exceptionReason.c_str()) ;
+ throw ErrorReadingFED (reponse->exceptionReason) ;
}
else
{
e = reponse->getException() ;
G.Out(pdGendoc,"exit FederationManagement::"
"createFederationExecution on exception
RTIinternalError");
- throw RTIinternalError (reponse->exceptionReason.c_str()) ;
+ throw RTIinternalError (reponse->exceptionReason) ;
D.Out(pdInit, "deja cree");
}
}
@@ -185,7 +185,7 @@
//! destroyFederationExecution.
void
FederationManagement::
-destroyFederationExecution(std::string theName,
+destroyFederationExecution(const std::string& theName,
TypeException &e)
{
NM_Destroy_Federation_Execution requete ;
@@ -231,8 +231,8 @@
//! joinFederationExecution.
FederateHandle
FederationManagement::
-joinFederationExecution(std::string Federate,
- std::string Federation,
+joinFederationExecution(const std::string& Federate,
+ const std::string& Federation,
RootObject* rootObject,
TypeException &e)
{
@@ -271,8 +271,8 @@
NM_Join_Federation_Execution* joinResponse =
static_cast<NM_Join_Federation_Execution*>(reponse.get());
rootObject->setFOM(*joinResponse);
- _nom_federation = std::string(Federation);
- _nom_federe = std::string(Federate);
+ _nom_federation = Federation;
+ _nom_federe = Federate;
_numero_federation = reponse->federation ;
federate = reponse->federate ;
tm->setFederate(reponse->federate);
@@ -363,8 +363,8 @@
// ----------------------------------------------------------------------------
//! Register synchronization.
void
-FederationManagement::registerSynchronization(std::string label,
- std::string tag,
+FederationManagement::registerSynchronization(const std::string& label,
+ const std::string& tag,
TypeException &e)
{
D.Out(pdProtocol, "RegisterSynchronization.");
@@ -374,10 +374,10 @@
e = e_NO_EXCEPTION ;
- list<char *>::const_iterator i = synchronizationLabels.begin();
+ list<std::string>::const_iterator i = synchronizationLabels.begin();
bool exists = false ;
for (; i != synchronizationLabels.end(); i++) {
- if (!strcmp((*i), label.c_str())) {
+ if ((*i) == label) {
e = e_FederationAlreadyPaused ; // Label already pending.
exists = true ;
break ;
@@ -385,7 +385,7 @@
}
if (!exists)
- synchronizationLabels.push_back(strdup(label.c_str()));
+ synchronizationLabels.push_back(label);
if (!_est_membre_federation)
e = e_FederateNotExecutionMember ;
@@ -411,8 +411,8 @@
// ----------------------------------------------------------------------------
//! Register synchronization with set of federates
void
-FederationManagement::registerSynchronization(std::string label,
- std::string tag,
+FederationManagement::registerSynchronization(const std::string& label,
+ const std::string& tag,
unsigned short array_size,
std::vector <FederateHandle>
&fed_array,
TypeException &e)
@@ -424,10 +424,10 @@
e = e_NO_EXCEPTION ;
- list<char *>::const_iterator i = synchronizationLabels.begin();
+ list<std::string>::const_iterator i = synchronizationLabels.begin();
bool exists = false ;
for (; i != synchronizationLabels.end(); i++) {
- if (!strcmp((*i), label.c_str())) {
+ if (*i == label) {
e = e_FederationAlreadyPaused ; // Label already pending.
exists = true ;
break ;
@@ -435,7 +435,7 @@
}
if (!exists)
- synchronizationLabels.push_back(strdup(label.c_str()));
+ synchronizationLabels.push_back(label);
if (!_est_membre_federation)
e = e_FederateNotExecutionMember ;
@@ -464,7 +464,7 @@
// ----------------------------------------------------------------------------
//! Unregister synchronization.
void
-FederationManagement::unregisterSynchronization(std::string label,
+FederationManagement::unregisterSynchronization(const std::string& label,
TypeException &e)
{
D.Out(pdProtocol, "unregisterSynchronization.");
@@ -474,10 +474,10 @@
e = e_NO_EXCEPTION ;
// Find if this label has been requested by federate or RTIG.
- list<char *>::iterator i = synchronizationLabels.begin();
+ list<std::string>::iterator i = synchronizationLabels.begin();
bool exists = false ;
for (; i != synchronizationLabels.end(); ++i) {
- if (!strcmp((*i), label.c_str())) {
+ if (*i == label) {
// Label already pending.
exists = true ;
break ;
@@ -490,7 +490,6 @@
* the label has been allocated using strdup (i.e. malloc-like)
* so that we MUST use free (and not delete[]) to free it :))
*/
- free(*i);
synchronizationLabels.erase(i);
}
@@ -510,48 +509,44 @@
// ----------------------------------------------------------------------------
void
-FederationManagement::announceSynchronizationPoint(const char *label,
- const char *tag)
+FederationManagement::announceSynchronizationPoint(const std::string& label,
+ const std::string& tag)
{
- D.Out(pdInit, "Announce Synchronization Point \"%s\"(%s).", label, tag);
+ D.Out(pdInit, "Announce Synchronization Point \"%s\"(%s).", label.c_str(),
tag.c_str());
Message req;
- assert(label != NULL);
-
req.type = Message::ANNOUNCE_SYNCHRONIZATION_POINT ;
req.setLabel(label);
req.setTag(tag);
// adding label to list of synchronizations to be done.
- list<char *>::const_iterator i = synchronizationLabels.begin();
+ list<std::string>::const_iterator i = synchronizationLabels.begin();
bool exists = false ;
for (; i != synchronizationLabels.end(); i++) {
- if (!strcmp((*i), label)) {
+ if ((*i) == label) {
// label exists (only if initiator).
exists = true ;
break ;
}
}
if (!exists)
- synchronizationLabels.push_back(strdup(label));
+ synchronizationLabels.push_back(label);
comm->requestFederateService(&req);
}
// ----------------------------------------------------------------------------
void FederationManagement::
-synchronizationPointRegistrationFailed(const char *label)
+synchronizationPointRegistrationFailed(const std::string& label)
{
D.Out(pdInit, "Synchronization Point Registration Failed \"%s\".",
- label);
+ label.c_str());
Message req;
G.Out(pdGendoc,"enter
FederationManagement::synchronizationPointRegistrationFailed");
- assert(label != NULL);
-
req.type = Message::SYNCHRONIZATION_POINT_REGISTRATION_FAILED ;
req.setLabel(label);
@@ -563,17 +558,15 @@
// ----------------------------------------------------------------------------
void FederationManagement::
-synchronizationPointRegistrationSucceeded(const char *label)
+synchronizationPointRegistrationSucceeded(const std::string& label)
{
D.Out(pdInit, "Synchronization Point Registration Succeeded \"%s\".",
- label);
+ label.c_str());
Message req;
G.Out(pdGendoc,"enter
FederationManagement::synchronizationPointRegistrationSucceeded");
- assert(label != NULL);
-
req.type = Message::SYNCHRONIZATION_POINT_REGISTRATION_SUCCEEDED ;
req.setLabel(label);
@@ -585,14 +578,12 @@
// ----------------------------------------------------------------------------
void
-FederationManagement::federationSynchronized(const char *label)
+FederationManagement::federationSynchronized(const std::string& label)
{
- D.Out(pdInit, "Federation Synchronized \"%s\".", label);
+ D.Out(pdInit, "Federation Synchronized \"%s\".", label.c_str());
Message req;
- assert(label != NULL);
-
req.type = Message::FEDERATION_SYNCHRONIZED ;
req.setLabel(label);
@@ -602,7 +593,7 @@
// ----------------------------------------------------------------------------
// requestFederationSave with time
void
-FederationManagement::requestFederationSave(std::string label,
+FederationManagement::requestFederationSave(const std::string& label,
FederationTime the_time,
TypeException &e)
{
@@ -610,8 +601,6 @@
G.Out(pdGendoc,"enter FederationManagement::requestFederationSave "
"with time");
- //assert(label != 0);
-
NM_Request_Federation_Save req ;
req.setDate(the_time);
@@ -632,15 +621,13 @@
// ----------------------------------------------------------------------------
// requestFederationSave without time
void
-FederationManagement::requestFederationSave(std::string label,
+FederationManagement::requestFederationSave(const std::string& label,
TypeException &e)
{
D.Out(pdInit, "Request for federation save \"%s\".", label.c_str());
G.Out(pdGendoc,"enter FederationManagement::requestFederationSave "
"without time");
- //assert(label != 0);
-
NM_Request_Federation_Save req ;
req.setLabel(label);
@@ -707,17 +694,15 @@
// ----------------------------------------------------------------------------
void
-FederationManagement::initiateFederateSave(const char *label)
+FederationManagement::initiateFederateSave(const std::string& label)
{
G.Out(pdGendoc,"enter FederationManagement::initiateFederateSave");
- D.Out(pdInit, "Initiate a federate save \"%s\".", label);
+ D.Out(pdInit, "Initiate a federate save \"%s\".", label.c_str());
savingState = true ;
Message req;
- assert(label != 0);
-
req.type = Message::INITIATE_FEDERATE_SAVE ;
req.setLabel(label);
@@ -746,14 +731,12 @@
// ----------------------------------------------------------------------------
void
-FederationManagement::requestFederationRestore(std::string label,
+FederationManagement::requestFederationRestore(const std::string& label,
TypeException &)
{
G.Out(pdGendoc,"enter FederationManagement::requestFederationRestore");
D.Out(pdInit, "Request for federation restore \"%s\".", label.c_str());
- //assert(label != NULL);
-
NM_Request_Federation_Restore req ;
req.setLabel(label);
@@ -787,8 +770,8 @@
// ----------------------------------------------------------------------------
void
FederationManagement::requestFederationRestoreStatus(bool status,
- const char *label,
- const char *reason)
+ const std::string& label,
+ const std::string& reason)
{
G.Out(pdGendoc,"enter
FederationManagement::requestFederationRestoreStatus");
D.Out(pdInit, "Federation restore request %saccepted",
@@ -826,12 +809,12 @@
// ----------------------------------------------------------------------------
void
-FederationManagement::initiateFederateRestore(const char *label,
+FederationManagement::initiateFederateRestore(const std::string& label,
FederateHandle handle)
{
G.Out(pdGendoc,"enter FederationManagement::initiateFederateRestore");
D.Out(pdInit, "Initiate federate restore \"%s\" with federate handle %d.",
- label, handle);
+ label.c_str(), handle);
restoringState = true ;
Index: RTIA/DataDistribution.hh
===================================================================
RCS file: /sources/certi/certi/RTIA/DataDistribution.hh,v
retrieving revision 3.16
retrieving revision 3.17
diff -u -b -r3.16 -r3.17
--- RTIA/DataDistribution.hh 10 Jun 2008 13:41:44 -0000 3.16
+++ RTIA/DataDistribution.hh 19 Nov 2009 18:15:30 -0000 3.17
@@ -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: DataDistribution.hh,v 3.16 2008/06/10 13:41:44 rousse Exp $
+// $Id: DataDistribution.hh,v 3.17 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_DATA_DISTRIBUTION
@@ -37,14 +37,14 @@
public:
DataDistribution(RootObject *, FederationManagement *, Communications *);
- SpaceHandle getRoutingSpaceHandle(std::string) const ;
+ SpaceHandle getRoutingSpaceHandle(const std::string&) const ;
- std::string getRoutingSpaceName(SpaceHandle) const ;
+ const std::string& getRoutingSpaceName(SpaceHandle) const ;
- DimensionHandle getDimensionHandle(std::string, SpaceHandle) const
+ DimensionHandle getDimensionHandle(const std::string&, SpaceHandle) const
throw (SpaceNotDefined, NameNotFound);
- std::string getDimensionName(DimensionHandle, SpaceHandle) const
+ const std::string& getDimensionName(DimensionHandle, SpaceHandle) const
throw (SpaceNotDefined, DimensionNotDefined);
SpaceHandle getAttributeSpace(AttributeHandle, ObjectClassHandle) const
@@ -66,7 +66,7 @@
int, TypeException &)
throw (RegionNotKnown);
- ObjectHandle registerObject(ObjectClassHandle, const std::string,
+ ObjectHandle registerObject(ObjectClassHandle, const std::string&,
const std::vector <AttributeHandle> &, int,
const std::vector<RegionHandle>,
TypeException &);
@@ -99,4 +99,4 @@
#endif // _CERTI_DATA_DISTRIBUTION
-// $Id: DataDistribution.hh,v 3.16 2008/06/10 13:41:44 rousse Exp $
+// $Id: DataDistribution.hh,v 3.17 2009/11/19 18:15:30 erk Exp $
Index: RTIA/OwnershipManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/OwnershipManagement.cc,v
retrieving revision 3.20
retrieving revision 3.21
diff -u -b -r3.20 -r3.21
--- RTIA/OwnershipManagement.cc 21 Oct 2009 18:56:29 -0000 3.20
+++ RTIA/OwnershipManagement.cc 19 Nov 2009 18:15:30 -0000 3.21
@@ -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: OwnershipManagement.cc,v 3.20 2009/10/21 18:56:29 erk Exp $
+// $Id: OwnershipManagement.cc,v 3.21 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -130,7 +130,7 @@
negotiatedAttributeOwnershipDivestiture(ObjectHandle theObject,
std::vector <AttributeHandle>
&attribArray,
UShort attribArraySize,
- std::string theTag,
+ const std::string& theTag,
TypeException &e)
{
@@ -257,7 +257,7 @@
attributeOwnershipAcquisition(ObjectHandle theObject,
std::vector <AttributeHandle> &attribArray,
UShort attribArraySize,
- std::string theTag,
+ const std::string& theTag,
TypeException &e)
{
NM_Attribute_Ownership_Acquisition req;
@@ -441,7 +441,7 @@
std::vector <AttributeHandle>
&the_attributes,
UShort the_size,
FederateHandle,
- std::string the_tag,
+ const std::string& the_tag,
TypeException &)
{
Message req;
@@ -461,7 +461,7 @@
requestAttributeOwnershipRelease(ObjectHandle the_object,
std::vector <AttributeHandle> &the_attributes,
UShort the_size,
- std::string the_tag,
+ const std::string& the_tag,
TypeException &)
{
Message req;
@@ -512,4 +512,4 @@
}} // namespace certi/rtia
-// $Id: OwnershipManagement.cc,v 3.20 2009/10/21 18:56:29 erk Exp $
+// $Id: OwnershipManagement.cc,v 3.21 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/RoutingSpace.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/RoutingSpace.cc,v
retrieving revision 3.15
retrieving revision 3.16
diff -u -b -r3.15 -r3.16
--- libCERTI/RoutingSpace.cc 12 Jun 2008 07:39:49 -0000 3.15
+++ libCERTI/RoutingSpace.cc 19 Nov 2009 18:15:30 -0000 3.16
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: RoutingSpace.cc,v 3.15 2008/06/12 07:39:49 erk Exp $
+// $Id: RoutingSpace.cc,v 3.16 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
@@ -33,7 +33,6 @@
using std::vector ;
using std::cout ;
using std::endl ;
-using std::string ;
namespace certi {
@@ -62,7 +61,7 @@
// ----------------------------------------------------------------------------
DimensionHandle
-RoutingSpace::getDimensionHandle(std::string dimension_name) const
+RoutingSpace::getDimensionHandle(const std::string& dimension_name) const
throw (NameNotFound)
{
vector<Dimension>::const_iterator it = std::find_if(
@@ -77,7 +76,7 @@
}
// ----------------------------------------------------------------------------
-string
+const std::string&
RoutingSpace::getDimensionName(DimensionHandle dimension_handle) const
throw (DimensionNotDefined)
{
@@ -117,4 +116,4 @@
} // namespace certi
-// $Id: RoutingSpace.cc,v 3.15 2008/06/12 07:39:49 erk Exp $
+// $Id: RoutingSpace.cc,v 3.16 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/ObjectClassAttribute.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassAttribute.hh,v
retrieving revision 3.26
retrieving revision 3.27
diff -u -b -r3.26 -r3.27
--- libCERTI/ObjectClassAttribute.hh 16 Dec 2008 07:08:29 -0000 3.26
+++ libCERTI/ObjectClassAttribute.hh 19 Nov 2009 18:15:30 -0000 3.27
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassAttribute.hh,v 3.26 2008/12/16 07:08:29 approx Exp $
+// $Id: ObjectClassAttribute.hh,v 3.27 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_OBJECT_CLASS_ATTRIBUTE_HH
@@ -54,7 +54,7 @@
*/
typedef std::set<FederateHandle> PublishersList_t;
- ObjectClassAttribute(const std::string theName, TransportType
theTransport, OrderType theOrder);
+ ObjectClassAttribute(const std::string& theName, TransportType
theTransport, OrderType theOrder);
ObjectClassAttribute(ObjectClassAttribute *source);
virtual ~ObjectClassAttribute();
@@ -67,7 +67,7 @@
SpaceHandle getSpace() const ;
// Security methods
- virtual void checkFederateAccess(FederateHandle the_federate, const char
*reason) const ;
+ virtual void checkFederateAccess(FederateHandle the_federate, const
std::string& reason) const ;
// Publish methods
bool isPublishing(FederateHandle) const ;
@@ -108,4 +108,4 @@
#endif // CERTI_OBJECT_CLASS_ATTRIBUTE_HH
-// $Id: ObjectClassAttribute.hh,v 3.26 2008/12/16 07:08:29 approx Exp $
+// $Id: ObjectClassAttribute.hh,v 3.27 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/SecurityServer.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/SecurityServer.cc,v
retrieving revision 3.17
retrieving revision 3.18
diff -u -b -r3.17 -r3.18
--- libCERTI/SecurityServer.cc 21 Oct 2009 20:04:46 -0000 3.17
+++ libCERTI/SecurityServer.cc 19 Nov 2009 18:15:30 -0000 3.18
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: SecurityServer.cc,v 3.17 2009/10/21 20:04:46 erk Exp $
+// $Id: SecurityServer.cc,v 3.18 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
@@ -76,7 +76,6 @@
Socket *FederateSocket=NULL;
SecureTCPSocket *SecureSocket=NULL;
- const char *FederateName ;
SecurityLevelID FederateLevel ;
// 1- Get the socket of this federate
@@ -99,7 +98,7 @@
}
// 3- If yes, retrieve federate principal name.
- FederateName = SecureSocket->getPeerName();
+ const char *FederateName = SecureSocket->getPeerName();
// 4- Retrieve Federate level
FederateLevel = getLevel(FederateName);
@@ -134,7 +133,7 @@
// ----------------------------------------------------------------------------
//! Returns the federate level id stored in a FederateLevelList.
SecurityLevelID
-SecurityServer::getLevel(const char *theFederate) const
+SecurityServer::getLevel(const std::string& theFederate) const
{
return FedLevelList.getLevel(theFederate);
}
@@ -142,21 +141,21 @@
// ----------------------------------------------------------------------------
//! Returns the level ID associated with name otherwise creates a new one.
SecurityLevelID
-SecurityServer::getLevelIDWithName(const char *theName)
+SecurityServer::getLevelIDWithName(const std::string& theName)
{
if (empty()) {
Debug(D, pdDebug) << "Empty list: added default (public) level" << endl
;
insertPublicLevel();
}
- if ((theName == NULL) || (strlen(theName) > MAX_SECURITYLEVELNAME)) {
- Debug(D, pdDebug) << "Security Level Name null or too long." << endl ;
- throw RTIinternalError("Security Level Name null or too long.");
+ if (theName.empty()) {
+ Debug(D, pdDebug) << "Security Level Name empty." << endl ;
+ throw RTIinternalError("Security Level Name empty.");
}
list<SecurityLevel *>::const_iterator i = begin();
for (; i != end(); i++) {
- if (strcmp((*i)->Name, theName) == 0)
+ if ((*i)->Name == theName)
return (*i)->LevelID ;
}
@@ -188,7 +187,7 @@
// ----------------------------------------------------------------------------
//! Register a new federate with security level id.
void
-SecurityServer::registerFederate(const char *the_federate,
+SecurityServer::registerFederate(const std::string& the_federate,
SecurityLevelID the_level_id)
{
FedLevelList.addFederate(the_federate, the_level_id);
@@ -196,4 +195,4 @@
}
-// $Id: SecurityServer.cc,v 3.17 2009/10/21 20:04:46 erk Exp $
+// $Id: SecurityServer.cc,v 3.18 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/Interaction.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Interaction.cc,v
retrieving revision 3.55
retrieving revision 3.56
diff -u -b -r3.55 -r3.56
--- libCERTI/Interaction.cc 18 Nov 2009 18:50:48 -0000 3.55
+++ libCERTI/Interaction.cc 19 Nov 2009 18:15:30 -0000 3.56
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Interaction.cc,v 3.55 2009/11/18 18:50:48 erk Exp $
+// $Id: Interaction.cc,v 3.56 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
@@ -221,7 +221,7 @@
*/
void
Interaction::checkFederateAccess(FederateHandle the_federate,
- const char *reason) const
+ const std::string& reason) const
throw (SecurityError)
{
// BUG: Should at least but a line in Audit
@@ -293,7 +293,7 @@
// ----------------------------------------------------------------------------
//! Returns the parameter handle obtained by its name.
ParameterHandle
-Interaction::getParameterHandle(const char *the_name) const
+Interaction::getParameterHandle(const std::string& the_name) const
throw (NameNotFound, RTIinternalError)
{
list<Parameter *>::const_iterator p ;
@@ -407,7 +407,7 @@
UShort list_size,
FederationTime time,
const RTIRegion *region,
- const char *the_tag)
+ const std::string& the_tag)
throw (FederateNotPublishing,
InteractionClassNotDefined,
InteractionParameterNotDefined,
@@ -467,7 +467,7 @@
std::vector <ParameterValue_t> &value_list,
UShort list_size,
const RTIRegion *region,
- const char *the_tag)
+ const std::string& the_tag)
throw (FederateNotPublishing,
InteractionClassNotDefined,
InteractionParameterNotDefined,
@@ -547,4 +547,4 @@
} // namespace certi
-// $Id: Interaction.cc,v 3.55 2009/11/18 18:50:48 erk Exp $
+// $Id: Interaction.cc,v 3.56 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/ObjectAttribute.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectAttribute.hh,v
retrieving revision 3.17
retrieving revision 3.18
diff -u -b -r3.17 -r3.18
--- libCERTI/ObjectAttribute.hh 7 Dec 2008 20:16:14 -0000 3.17
+++ libCERTI/ObjectAttribute.hh 19 Nov 2009 18:15:30 -0000 3.18
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectAttribute.hh,v 3.17 2008/12/07 20:16:14 gotthardp Exp $
+// $Id: ObjectAttribute.hh,v 3.18 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_OBJECT_ATTRIBUTE_HH
@@ -49,7 +49,6 @@
// Public Methods
// Constructors & Destructors
- ObjectAttribute(); //!< Declared by not defined (Don't call it).
ObjectAttribute(AttributeHandle, FederateHandle, ObjectClassAttribute *);
~ObjectAttribute();
@@ -81,6 +80,8 @@
const RTIRegion *getRegion() const { return region ; };
private:
+ ObjectAttribute(); //!< Declared by not defined (Don't call it).
+
// Private Attributes
AttributeHandle handle ; //!< The object attribute handle.
FederateHandle owner ; //!< Federate who owns the attribute.
@@ -95,4 +96,4 @@
#endif // CERTI_OBJECT_ATTRIBUTE_HH
-// $Id: ObjectAttribute.hh,v 3.17 2008/12/07 20:16:14 gotthardp Exp $
+// $Id: ObjectAttribute.hh,v 3.18 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/InteractionSet.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/InteractionSet.hh,v
retrieving revision 3.24
retrieving revision 3.25
diff -u -b -r3.24 -r3.25
--- libCERTI/InteractionSet.hh 8 Nov 2008 11:08:03 -0000 3.24
+++ libCERTI/InteractionSet.hh 19 Nov 2009 18:15:30 -0000 3.25
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: InteractionSet.hh,v 3.24 2008/11/08 11:08:03 erk Exp $
+// $Id: InteractionSet.hh,v 3.25 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_INTERACTION_SET_HH
@@ -70,12 +70,12 @@
* @param[in] the_handle the handle of the interaction whose name is
requested
* @return the interaction class name
*/
- std::string
+ const std::string&
getInteractionClassName(InteractionClassHandle the_handle) const
throw (InteractionClassNotDefined);
ParameterHandle
- getParameterHandle(const char *the_name,
+ getParameterHandle(const std::string& the_name,
InteractionClassHandle the_class)
throw (NameNotFound,
InteractionClassNotDefined,
@@ -130,7 +130,7 @@
UShort theListSize,
FederationTime theTime,
const RTIRegion *,
- const char *theTag)
+ const std::string& theTag)
throw (FederateNotPublishing,
InteractionClassNotDefined,
InteractionParameterNotDefined,
@@ -142,7 +142,7 @@
std::vector <ParameterValue_t> &theValueList,
UShort theListSize,
const RTIRegion *,
- const char *theTag)
+ const std::string& theTag)
throw (FederateNotPublishing,
InteractionClassNotDefined,
InteractionParameterNotDefined,
@@ -157,4 +157,4 @@
#endif // _CERTI_INTERACTION_SET_HH
-// $Id: InteractionSet.hh,v 3.24 2008/11/08 11:08:03 erk Exp $
+// $Id: InteractionSet.hh,v 3.25 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/ObjectClass.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.cc,v
retrieving revision 3.69
retrieving revision 3.70
diff -u -b -r3.69 -r3.70
--- libCERTI/ObjectClass.cc 18 Nov 2009 18:50:48 -0000 3.69
+++ libCERTI/ObjectClass.cc 19 Nov 2009 18:15:30 -0000 3.70
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClass.cc,v 3.69 2009/11/18 18:50:48 erk Exp $
+// $Id: ObjectClass.cc,v 3.70 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#include "Object.hh"
@@ -225,7 +225,7 @@
ObjectClass::sendToOwners(CDiffusion *diffusionList,
ObjectHandle theObjectHandle,
FederateHandle theFederate,
- const char *theTag,
+ const std::string& theTag,
NetworkMessage::Type type)
{
int nbAttributes = diffusionList->size ;
@@ -265,7 +265,7 @@
*/
void
ObjectClass::checkFederateAccess(FederateHandle the_federate,
- const char *reason)
+ const std::string& reason)
throw (SecurityError)
{
D.Out(pdInit, "Beginning of CheckFederateAccess for the federate %d",
@@ -286,7 +286,7 @@
}
// ----------------------------------------------------------------------------
-ObjectClass::ObjectClass(std::string name, ObjectClassHandle handle)
+ObjectClass::ObjectClass(const std::string& name, ObjectClassHandle handle)
: Named(name), server(NULL), handle(handle), maxSubscriberHandle(0),
securityLevelId(PublicLevelID),
superClass(0), subClasses(NULL)
{
@@ -325,7 +325,7 @@
ObjectClass::deleteInstance(FederateHandle the_federate,
ObjectHandle the_object,
FederationTime theTime,
- std::string the_tag)
+ const std::string& the_tag)
throw (DeletePrivilegeNotHeld,
ObjectNotKnown,
RTIinternalError)
@@ -393,7 +393,7 @@
ObjectClassBroadcastList *
ObjectClass::deleteInstance(FederateHandle the_federate,
ObjectHandle the_object,
- std::string the_tag)
+ const std::string& the_tag)
throw (DeletePrivilegeNotHeld,
ObjectNotKnown,
RTIinternalError)
@@ -483,33 +483,33 @@
// ----------------------------------------------------------------------------
//! getAttributeHandle.
AttributeHandle
-ObjectClass::getAttributeHandle(const char *the_name) const
+ObjectClass::getAttributeHandle(const std::string& the_name) const
throw (NameNotFound, RTIinternalError)
{
G.Out(pdGendoc,"enter ObjectClass::getAttributeHandle");
list<ObjectClassAttribute *>::const_iterator a ;
for (a = attributeSet.begin(); a != attributeSet.end(); a++) {
- if ((*a)->isNamed(std::string(the_name))) {
+ if ((*a)->isNamed(the_name)) {
G.Out(pdGendoc,"exit ObjectClass::getAttributeHandle");
return (*a)->getHandle();
}
}
D.Out(pdExcept, "ObjectClass %u: Attribute \"%s\" not defined.",
- handle, the_name);
+ handle, the_name.c_str());
G.Out(pdGendoc,"exit ObjectClass::getAttributeHandle on NameNotFound");
throw NameNotFound(the_name);
}
// ----------------------------------------------------------------------------
//! getAttributeName.
-const char *
+const std::string&
ObjectClass::getAttributeName(AttributeHandle the_handle) const
throw (AttributeNotDefined,
RTIinternalError)
{
- return getAttribute(the_handle)->getCName();
+ return getAttribute(the_handle)->getName();
}
@@ -710,7 +710,7 @@
// Pre-conditions checking
if (isInstanceInClass(the_object->getHandle())) {
D.Out(pdExcept, "exception : ObjectAlreadyRegistered.");
- throw ObjectAlreadyRegistered(the_object->getName().c_str());
+ throw ObjectAlreadyRegistered(the_object->getName());
}
// This condition is only to be checked on the RTIG
@@ -754,7 +754,7 @@
answer->setException(e_NO_EXCEPTION) ;
answer->objectClass = handle ; // Class Handle
answer->object = the_object->getHandle();
- answer->setLabel(the_object->getName().c_str());
+ answer->setLabel(the_object->getName());
// BUG FIXME strange!!
//answer->setDate(0.0);
@@ -804,7 +804,7 @@
message.setException(e_NO_EXCEPTION) ;
message.objectClass = super_handle ;
message.object = (*o)->getHandle();
- message.setLabel((*o)->getName().c_str());
+ message.setLabel((*o)->getName());
//BUG FIXME strange!!
//message.setDate(0.0);
@@ -886,7 +886,7 @@
std::vector <AttributeValue_t> &the_values,
int the_size,
FederationTime the_time,
- const char *the_tag)
+ const std::string& the_tag)
throw (ObjectNotKnown,
AttributeNotDefined,
AttributeNotOwned,
@@ -949,7 +949,7 @@
std::vector <AttributeHandle>
&the_attributes,
std::vector <AttributeValue_t> &the_values,
int the_size,
- const char *the_tag)
+ const std::string& the_tag)
throw (ObjectNotKnown,
AttributeNotDefined,
AttributeNotOwned,
@@ -1012,7 +1012,7 @@
ObjectHandle theObjectHandle,
std::vector <AttributeHandle>
&theAttributeList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (ObjectNotKnown,
AttributeNotDefined,
AttributeNotOwned,
@@ -1118,7 +1118,7 @@
AnswerDivestiture.federation = server->federation();
AnswerDivestiture.federate = theFederateHandle ;
AnswerDivestiture.object = theObjectHandle ;
- AnswerDivestiture.setLabel(std::string(""));
+ AnswerDivestiture.setLabel(std::string());
AnswerDivestiture.handleArraySize = compteur_divestiture ;
sendToFederate(&AnswerDivestiture, theFederateHandle);
@@ -1386,7 +1386,7 @@
AnswerAssumption->federate = theFederateHandle ;
AnswerAssumption->setException(e_NO_EXCEPTION) ;
AnswerAssumption->object = theObjectHandle ;
- AnswerAssumption->setLabel(std::string(""));
+ AnswerAssumption->setLabel(std::string());
AnswerAssumption->handleArraySize = compteur_assumption ;
List = new ObjectClassBroadcastList(AnswerAssumption,
@@ -1428,7 +1428,7 @@
ObjectHandle theObjectHandle,
std::vector <AttributeHandle>
&theAttributeList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (ObjectNotKnown,
ObjectClassNotPublished,
AttributeNotDefined,
@@ -1834,4 +1834,4 @@
} // namespace certi
-// $Id: ObjectClass.cc,v 3.69 2009/11/18 18:50:48 erk Exp $
+// $Id: ObjectClass.cc,v 3.70 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/Interaction.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Interaction.hh,v
retrieving revision 3.37
retrieving revision 3.38
diff -u -b -r3.37 -r3.38
--- libCERTI/Interaction.hh 18 Nov 2009 18:50:48 -0000 3.37
+++ libCERTI/Interaction.hh 19 Nov 2009 18:15:30 -0000 3.38
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Interaction.hh,v 3.37 2009/11/18 18:50:48 erk Exp $
+// $Id: Interaction.hh,v 3.38 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_INTERACTION_HH
@@ -105,7 +105,7 @@
* @param[in] subClassName the name of the subclass
* @return the sub class object class.
*/
- Interaction* getSubClassByName(const std::string subClassName);
+ Interaction* getSubClassByName(const std::string& subClassName);
/**
* Get the whole set of subclasses.
*/
@@ -119,7 +119,7 @@
// -- Security Methods --
void checkFederateAccess(FederateHandle the_federate,
- const char *reason) const
+ const std::string& reason) const
throw (SecurityError);
SecurityLevelID getSecurityLevelId() const { return id ; };
@@ -133,7 +133,7 @@
throw (FederateNotPublishing, RTIinternalError, SecurityError);
// -- RTI Support Services --
- ParameterHandle getParameterHandle(const char *) const
+ ParameterHandle getParameterHandle(const std::string&) const
throw (NameNotFound, RTIinternalError);
/**
@@ -170,7 +170,7 @@
UShort list_size,
FederationTime the_time,
const RTIRegion *,
- const char *the_tag)
+ const std::string& the_tag)
throw (FederateNotPublishing,
InteractionClassNotDefined,
InteractionParameterNotDefined,
@@ -182,7 +182,7 @@
std::vector <ParameterValue_t> &value_list,
UShort list_size,
const RTIRegion *,
- const char *the_tag)
+ const std::string& the_tag)
throw (FederateNotPublishing,
InteractionClassNotDefined,
InteractionParameterNotDefined,
@@ -258,4 +258,4 @@
#endif // _CERTI_INTERACTION.HH
-// $Id: Interaction.hh,v 3.37 2009/11/18 18:50:48 erk Exp $
+// $Id: Interaction.hh,v 3.38 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/NetworkMessage.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage.cc,v
retrieving revision 3.40
retrieving revision 3.41
diff -u -b -r3.40 -r3.41
--- libCERTI/NetworkMessage.cc 14 Sep 2009 21:21:31 -0000 3.40
+++ libCERTI/NetworkMessage.cc 19 Nov 2009 18:15:30 -0000 3.41
@@ -16,7 +16,7 @@
// License along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: NetworkMessage.cc,v 3.40 2009/09/14 21:21:31 erk Exp $
+// $Id: NetworkMessage.cc,v 3.41 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
@@ -43,13 +43,10 @@
_isTagged(false)
{
name = std::string("NetworkMessage (generic)");
- exceptionReason = std::string("") ;
federation = 0 ;
federate = 0 ;
- label = std::string("") ;
-
bestEffortPeer = -1 ;
bestEffortAddress = 0 ;
numberOfRegulators = 0;
@@ -161,4 +158,4 @@
} // namespace certi
-// $Id: NetworkMessage.cc,v 3.40 2009/09/14 21:21:31 erk Exp $
+// $Id: NetworkMessage.cc,v 3.41 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/ObjectClass.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.hh,v
retrieving revision 3.46
retrieving revision 3.47
diff -u -b -r3.46 -r3.47
--- libCERTI/ObjectClass.hh 18 Nov 2009 18:50:48 -0000 3.46
+++ libCERTI/ObjectClass.hh 19 Nov 2009 18:15:30 -0000 3.47
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClass.hh,v 3.46 2009/11/18 18:50:48 erk Exp $
+// $Id: ObjectClass.hh,v 3.47 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_OBJECT_CLASS_HH
@@ -94,7 +94,7 @@
* @param[in] name the object class name
* @param[in] handle the object class handle value
*/
- ObjectClass(const std::string name, ObjectClassHandle handle);
+ ObjectClass(const std::string& name, ObjectClassHandle handle);
/**
* Destroy an object class.
@@ -126,14 +126,14 @@
* @param[in] subClassName the name of the subclass
* @return the sub class object class.
*/
- ObjectClass* getSubClassByName(const std::string subClassName);
+ ObjectClass* getSubClassByName(const std::string& subClassName);
/**
* Get the whole set of subclasses.
*/
ObjectClassSet* getSubClasses() {return subClasses;};
// Security Methods
- void checkFederateAccess(FederateHandle, const char *)
+ void checkFederateAccess(FederateHandle, const std::string&)
throw (SecurityError);
SecurityLevelID getSecurityLevelId() const { return securityLevelId ; };
@@ -162,7 +162,7 @@
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (ObjectNotKnown, AttributeNotDefined,
AttributeNotOwned,
AttributeAlreadyBeingDivested,
RTIinternalError);
@@ -189,7 +189,7 @@
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (ObjectNotKnown, ObjectClassNotPublished, AttributeNotDefined,
AttributeNotPublished, FederateOwnsAttributes,
RTIinternalError);
@@ -209,10 +209,10 @@
AttributeAcquisitionWasNotRequested, RTIinternalError);
// RTI Support Services
- AttributeHandle getAttributeHandle(const char *theName) const
+ AttributeHandle getAttributeHandle(const std::string& theName) const
throw (NameNotFound, RTIinternalError);
- const char *getAttributeName(AttributeHandle theHandle) const
+ const std::string& getAttributeName(AttributeHandle theHandle) const
throw (AttributeNotDefined, RTIinternalError);
ObjectClassBroadcastList *killFederate(FederateHandle theFederate)
@@ -225,14 +225,14 @@
ObjectClassBroadcastList *deleteInstance(FederateHandle
theFederateHandle,
ObjectHandle theObjectHandle,
FederationTime theTime,
- std::string theUserTag)
+ const std::string& theUserTag)
throw (DeletePrivilegeNotHeld,
ObjectNotKnown,
RTIinternalError);
ObjectClassBroadcastList *deleteInstance(FederateHandle
theFederateHandle,
ObjectHandle theObjectHandle,
- std::string theUserTag)
+ const std::string& theUserTag)
throw (DeletePrivilegeNotHeld,
ObjectNotKnown,
RTIinternalError);
@@ -249,13 +249,13 @@
ObjectClassBroadcastList *
updateAttributeValues(FederateHandle, Object *, std::vector
<AttributeHandle> &,
- std::vector <AttributeValue_t> &, int, FederationTime,
const char *)
+ std::vector <AttributeValue_t> &, int, FederationTime,
const std::string&)
throw (ObjectNotKnown, AttributeNotDefined,
AttributeNotOwned,
RTIinternalError, InvalidObjectHandle);
ObjectClassBroadcastList *
updateAttributeValues(FederateHandle, Object *, std::vector
<AttributeHandle> &,
- std::vector <AttributeValue_t> &, int, const char *)
+ std::vector <AttributeValue_t> &, int, const
std::string&)
throw (ObjectNotKnown, AttributeNotDefined,
AttributeNotOwned,
RTIinternalError, InvalidObjectHandle);
@@ -288,7 +288,7 @@
void sendToOwners(CDiffusion *diffusionList,
ObjectHandle theObjectHandle,
FederateHandle theFederate,
- const char *theTag,
+ const std::string& theTag,
NetworkMessage::Type type);
void sendMessage(NetworkMessage *msg, FederateHandle theDest);
@@ -334,4 +334,4 @@
#endif // _CERTI_OBJECT_CLASS_HH
-// $Id: ObjectClass.hh,v 3.46 2009/11/18 18:50:48 erk Exp $
+// $Id: ObjectClass.hh,v 3.47 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/RoutingSpace.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/RoutingSpace.hh,v
retrieving revision 3.11
retrieving revision 3.12
diff -u -b -r3.11 -r3.12
--- libCERTI/RoutingSpace.hh 18 Nov 2009 18:50:48 -0000 3.11
+++ libCERTI/RoutingSpace.hh 19 Nov 2009 18:15:30 -0000 3.12
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: RoutingSpace.hh,v 3.11 2009/11/18 18:50:48 erk Exp $
+// $Id: RoutingSpace.hh,v 3.12 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_ROUTING_SPACE
@@ -56,14 +56,14 @@
* @param dimension_name Dimension name
* @return Dimension handle
*/
- DimensionHandle getDimensionHandle(std::string dimension_name) const throw
(NameNotFound);
+ DimensionHandle getDimensionHandle(const std::string& dimension_name)
const throw (NameNotFound);
/**
* Get the name of the specified dimension
* @param dimension_handle Dimension handle
* @return the Dimension name
*/
- std::string getDimensionName(DimensionHandle dimension_handle) const
+ const std::string& getDimensionName(DimensionHandle dimension_handle) const
throw (DimensionNotDefined);
/**
@@ -96,5 +96,5 @@
#endif // _CERTI_ROUTING_SPACE
-// $Id: RoutingSpace.hh,v 3.11 2009/11/18 18:50:48 erk Exp $
+// $Id: RoutingSpace.hh,v 3.12 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/helper.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/helper.hh,v
retrieving revision 3.1
retrieving revision 3.2
diff -u -b -r3.1 -r3.2
--- libCERTI/helper.hh 9 Mar 2006 19:54:28 -0000 3.1
+++ libCERTI/helper.hh 19 Nov 2009 18:15:30 -0000 3.2
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: helper.hh,v 3.1 2006/03/09 19:54:28 breholee Exp $
+// $Id: helper.hh,v 3.2 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef LIBCERTI_HELPER_HH
@@ -50,7 +50,7 @@
class NameComparator
{
public:
- NameComparator(std::string h) : name(h) { };
+ NameComparator(const std::string& h) : name(h) { };
bool operator()(const T *op) const { return name == op->getName(); };
bool operator()(const T &op) const { return name == op.getName(); };
private:
@@ -61,4 +61,4 @@
#endif // LIBCERTI_HELPER_HH
-// $Id: helper.hh,v 3.1 2006/03/09 19:54:28 breholee Exp $
+// $Id: helper.hh,v 3.2 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/Parameter.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Parameter.cc,v
retrieving revision 3.10
retrieving revision 3.11
diff -u -b -r3.10 -r3.11
--- libCERTI/Parameter.cc 31 Aug 2007 12:47:40 -0000 3.10
+++ libCERTI/Parameter.cc 19 Nov 2009 18:15:30 -0000 3.11
@@ -19,14 +19,13 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Parameter.cc,v 3.10 2007/08/31 12:47:40 erk Exp $
+// $Id: Parameter.cc,v 3.11 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#include "Parameter.hh"
#include <stdio.h>
-#include <cstring>
#include <iostream>
namespace certi {
@@ -36,7 +35,7 @@
{
}
-Parameter::Parameter(std::string s)
+Parameter::Parameter(const std::string& s)
: Named(s), LevelID(PublicLevelID), handle(0)
{
}
@@ -51,4 +50,4 @@
} // namespace certi
-// $Id: Parameter.cc,v 3.10 2007/08/31 12:47:40 erk Exp $
+// $Id: Parameter.cc,v 3.11 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/SecurityLevel.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/SecurityLevel.hh,v
retrieving revision 3.11
retrieving revision 3.12
diff -u -b -r3.11 -r3.12
--- libCERTI/SecurityLevel.hh 7 Dec 2008 20:16:15 -0000 3.11
+++ libCERTI/SecurityLevel.hh 19 Nov 2009 18:15:30 -0000 3.12
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: SecurityLevel.hh,v 3.11 2008/12/07 20:16:15 gotthardp Exp $
+// $Id: SecurityLevel.hh,v 3.12 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_SECURITY_LEVEL_HH
@@ -28,12 +28,9 @@
#include "certi.hh"
#include "Exception.hh"
-#include <stdlib.h>
-#include <string.h>
+#include <string>
-#define MAX_SECURITYLEVELNAME 500
-
-typedef char *SecurityLevelName ;
+typedef std::string SecurityLevelName ;
typedef unsigned short SecurityLevelID ;
#define PublicLevelID 0
@@ -47,26 +44,18 @@
SecurityLevelName Name ;
SecurityLevelID LevelID ;
- SecurityLevel(const char *InitName,
+ SecurityLevel(const std::string& InitName,
SecurityLevelID InitLevelID)
{
-/*#ifdef _WIN32
- if((InitName == NULL) ||(strlen(InitName) > MAX_SECURITYLEVELNAME))
-#else
- if((InitName == NULL) ||(std::strlen(InitName) > MAX_SECURITYLEVELNAME))
-#endif*/
-
- if ((InitName == NULL) || (strlen(InitName) > MAX_SECURITYLEVELNAME))
+ if (InitName.empty())
throw RTIinternalError("Bad Security Level Name.");
- Name = strdup(InitName);
+ Name = InitName;
LevelID = InitLevelID ;
}
-
- ~SecurityLevel() { if (Name != NULL) free(Name); };
};
}
#endif // _CERTI_SECURITY_LEVEL_HH
-// $Id: SecurityLevel.hh,v 3.11 2008/12/07 20:16:15 gotthardp Exp $
+// $Id: SecurityLevel.hh,v 3.12 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/SecurityServer.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/SecurityServer.hh,v
retrieving revision 3.11
retrieving revision 3.12
diff -u -b -r3.11 -r3.12
--- libCERTI/SecurityServer.hh 22 Jun 2007 08:51:39 -0000 3.11
+++ libCERTI/SecurityServer.hh 19 Nov 2009 18:15:30 -0000 3.12
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: SecurityServer.hh,v 3.11 2007/06/22 08:51:39 erk Exp $
+// $Id: SecurityServer.hh,v 3.12 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_SECURITY_SERVER_HH
@@ -65,9 +65,9 @@
bool canFederateAccessData(FederateHandle theFederate,
SecurityLevelID theDataLevelID);
- SecurityLevelID getLevelIDWithName(const char *theName);
+ SecurityLevelID getLevelIDWithName(const std::string& theName);
- void registerFederate(const char *the_federate,
+ void registerFederate(const std::string& the_federate,
SecurityLevelID the_level_id);
private:
@@ -76,7 +76,7 @@
SecurityLevelID LastLevelID ; //!< Last Level ID attributed.
FederateLevelList FedLevelList ;
- SecurityLevelID getLevel(const char *theFederate) const ;
+ SecurityLevelID getLevel(const std::string& theFederate) const ;
void insertPublicLevel();
};
@@ -85,4 +85,4 @@
#endif // _CERTI_SECURITY_SERVER_HH
-// $Id: SecurityServer.hh,v 3.11 2007/06/22 08:51:39 erk Exp $
+// $Id: SecurityServer.hh,v 3.12 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/fed.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/fed.hh,v
retrieving revision 3.6
retrieving revision 3.7
diff -u -b -r3.6 -r3.7
--- libCERTI/fed.hh 30 Oct 2008 10:49:29 -0000 3.6
+++ libCERTI/fed.hh 19 Nov 2009 18:15:30 -0000 3.7
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: fed.hh,v 3.6 2008/10/30 10:49:29 erk Exp $
+// $Id: fed.hh,v 3.7 2009/11/19 18:15:30 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _FED_HH
@@ -27,8 +27,6 @@
#include "RootObject.hh"
-#include <string>
-
namespace certi {
namespace fedparser {
@@ -76,4 +74,4 @@
}
#endif // _FED_HH
-// $Id: fed.hh,v 3.6 2008/10/30 10:49:29 erk Exp $
+// $Id: fed.hh,v 3.7 2009/11/19 18:15:30 erk Exp $
Index: libCERTI/ObjectClassSet.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.hh,v
retrieving revision 3.36
retrieving revision 3.37
diff -u -b -r3.36 -r3.37
--- libCERTI/ObjectClassSet.hh 8 Nov 2008 11:36:04 -0000 3.36
+++ libCERTI/ObjectClassSet.hh 19 Nov 2009 18:15:31 -0000 3.37
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassSet.hh,v 3.36 2008/11/08 11:36:04 erk Exp $
+// $Id: ObjectClassSet.hh,v 3.37 2009/11/19 18:15:31 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_OBJECT_CLASS_SET_HH
@@ -61,18 +61,18 @@
void addClass(ObjectClass *theClass,ObjectClass *parentClass) throw
(RTIinternalError);
// RTI Support Services
- AttributeHandle getAttributeHandle(const char *the_name,
+ AttributeHandle getAttributeHandle(const std::string& the_name,
ObjectClassHandle the_class) const
throw (NameNotFound, ObjectClassNotDefined,
RTIinternalError);
- const char *getAttributeName(AttributeHandle the_handle,
+ const std::string& getAttributeName(AttributeHandle the_handle,
ObjectClassHandle the_class) const
throw (AttributeNotDefined, ObjectClassNotDefined,
RTIinternalError);
- ObjectClassHandle getObjectClassHandle(std::string) const
+ ObjectClassHandle getObjectClassHandle(const std::string&) const
throw (NameNotFound);
- std::string getObjectClassName(ObjectClassHandle the_handle) const
+ const std::string& getObjectClassName(ObjectClassHandle the_handle)
const
throw (ObjectClassNotDefined);
void killFederate(FederateHandle theFederate)
@@ -96,12 +96,12 @@
void deleteObject(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
FederationTime theTime,
- std::string theTag)
+ const std::string& theTag)
throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError);
void deleteObject(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
- std::string theTag)
+ const std::string& theTag)
throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError);
void registerObjectInstance(FederateHandle, Object *, ObjectClassHandle)
@@ -115,7 +115,7 @@
std::vector <AttributeValue_t> &theValueArray,
UShort theArraySize,
FederationTime theTime,
- const char *theUserTag)
+ const std::string& theUserTag)
throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
RTIinternalError, InvalidObjectHandle);
@@ -124,7 +124,7 @@
std::vector <AttributeHandle> &theAttribArray,
std::vector <AttributeValue_t> &theValueArray,
UShort theArraySize,
- const char *theUserTag)
+ const std::string& theUserTag)
throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
RTIinternalError, InvalidObjectHandle);
@@ -134,7 +134,7 @@
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
AttributeAlreadyBeingDivested, RTIinternalError);
@@ -158,7 +158,7 @@
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (ObjectNotKnown, ObjectClassNotPublished, AttributeNotDefined,
AttributeNotPublished, FederateOwnsAttributes,
RTIinternalError);
@@ -194,4 +194,4 @@
#endif // _CERTI_OBJECT_CLASS_SET_HH
-// $Id: ObjectClassSet.hh,v 3.36 2008/11/08 11:36:04 erk Exp $
+// $Id: ObjectClassSet.hh,v 3.37 2009/11/19 18:15:31 erk Exp $
Index: libCERTI/Named.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Named.hh,v
retrieving revision 3.9
retrieving revision 3.10
diff -u -b -r3.9 -r3.10
--- libCERTI/Named.hh 11 Oct 2009 14:55:01 -0000 3.9
+++ libCERTI/Named.hh 19 Nov 2009 18:15:31 -0000 3.10
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Named.hh,v 3.9 2009/10/11 14:55:01 erk Exp $
+// $Id: Named.hh,v 3.10 2009/11/19 18:15:31 erk Exp $
// ----------------------------------------------------------------------------
#ifndef LIBCERTI_NAMED_HH
@@ -66,24 +66,12 @@
virtual void setName(const std::string& newName);
/**
- * Set name (char* version)
- * @param[in] name the new name
- */
- virtual void setName(const char* newName);
-
- /**
* Get name.
* @return name value
*/
virtual const std::string& getName() const ;
/**
- * Get C-style name.
- * @return pointer on name, as const char *
- */
- virtual const char *getCName() const ;
-
- /**
* Check if the name matches the provided parameter.
* @param name String to compare
* @return true if strings match
@@ -121,11 +109,11 @@
* @param[in] qualifiedClassName
* @return the leaf class name
*/
- static std::string getLeafClassName(std::string qualifiedClassName);
+ static std::string getLeafClassName(const std::string&
qualifiedClassName);
class IsNamed {
public:
- IsNamed(const std::string named) : named(named) {};
+ IsNamed(const std::string& named) : named(named) {};
bool operator()(const Named& namedObject) {
return (namedObject.getName() == named);
}
@@ -142,4 +130,4 @@
#endif // LIBCERTI_NAMED_HH
-// $Id: Named.hh,v 3.9 2009/10/11 14:55:01 erk Exp $
+// $Id: Named.hh,v 3.10 2009/11/19 18:15:31 erk Exp $
Index: libCERTI/Subscribable.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Subscribable.hh,v
retrieving revision 3.7
retrieving revision 3.8
diff -u -b -r3.7 -r3.8
--- libCERTI/Subscribable.hh 8 Nov 2008 11:36:05 -0000 3.7
+++ libCERTI/Subscribable.hh 19 Nov 2009 18:15:31 -0000 3.8
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Subscribable.hh,v 3.7 2008/11/08 11:36:05 erk Exp $
+// $Id: Subscribable.hh,v 3.8 2009/11/19 18:15:31 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_SUBSCRIBABLE_HH
@@ -63,7 +63,7 @@
public:
virtual ~Subscribable();
- virtual void checkFederateAccess(FederateHandle, const char *) const = 0 ;
+ virtual void checkFederateAccess(FederateHandle, const std::string&) const
= 0 ;
virtual Handle getHandle() const = 0 ;
bool isSubscribed(FederateHandle, const RTIRegion *) const ;
@@ -85,4 +85,4 @@
#endif // CERTI_SUBSCRIBABLE_HH
-// $Id: Subscribable.hh,v 3.7 2008/11/08 11:36:05 erk Exp $
+// $Id: Subscribable.hh,v 3.8 2009/11/19 18:15:31 erk Exp $
Index: libCERTI/AuditLine.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/AuditLine.hh,v
retrieving revision 3.9
retrieving revision 3.10
diff -u -b -r3.9 -r3.10
--- libCERTI/AuditLine.hh 30 Apr 2005 16:48:25 -0000 3.9
+++ libCERTI/AuditLine.hh 19 Nov 2009 18:15:31 -0000 3.10
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: AuditLine.hh,v 3.9 2005/04/30 16:48:25 breholee Exp $
+// $Id: AuditLine.hh,v 3.10 2009/11/19 18:15:31 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_AUDIT_LINE_HH
@@ -37,13 +37,13 @@
public:
AuditLine();
- AuditLine(unsigned short, unsigned short, unsigned short, std::string);
+ AuditLine(unsigned short, unsigned short, unsigned short, const
std::string&);
~AuditLine();
void write(std::ofstream &); //!< Write data to file
void addComment(const std::string &); //!< Add str at the end of comment.
void end(unsigned short event_status = e_NO_EXCEPTION,
- std::string reason = "");
+ const std::string& reason = "");
unsigned short getLevel() const { return level ; };
unsigned short getStatus() const { return status ; };
bool started() const { return modified ; };
@@ -67,4 +67,4 @@
#endif // _CERTI_AUDIT_LINE_HH
-// $Id: AuditLine.hh,v 3.9 2005/04/30 16:48:25 breholee Exp $
+// $Id: AuditLine.hh,v 3.10 2009/11/19 18:15:31 erk Exp $
Index: libCERTI/ObjectSet.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectSet.cc,v
retrieving revision 3.26
retrieving revision 3.27
diff -u -b -r3.26 -r3.27
--- libCERTI/ObjectSet.cc 21 Oct 2009 18:56:28 -0000 3.26
+++ libCERTI/ObjectSet.cc 19 Nov 2009 18:15:31 -0000 3.27
@@ -94,7 +94,7 @@
// ----------------------------------------------------------------------------
ObjectHandle
-ObjectSet::getObjectInstanceHandle(std::string the_name) const
+ObjectSet::getObjectInstanceHandle(const std::string& the_name) const
throw (ObjectNotKnown, RTIinternalError)
{
std::map<ObjectHandle, Object *>::const_iterator i ;
@@ -109,13 +109,13 @@
}
// ----------------------------------------------------------------------------
-const char *
+const std::string&
ObjectSet::getObjectInstanceName(ObjectHandle the_object) const
throw (ObjectNotKnown, RTIinternalError)
{
Object *object = getObject(the_object);
- return object->getName().c_str();
+ return object->getName();
}
// ----------------------------------------------------------------------------
@@ -132,7 +132,7 @@
ObjectSet::registerObjectInstance(FederateHandle the_federate,
ObjectClassHandle the_class,
ObjectHandle the_object,
- std::string the_name)
+ const std::string& the_name)
throw (ObjectAlreadyRegistered, ConcurrentAccessAttempted,
SaveInProgress, RestoreInProgress, RTIinternalError)
{
@@ -174,7 +174,7 @@
void
ObjectSet::deleteObjectInstance(FederateHandle,
ObjectHandle the_object,
- std::string the_tag)
+ const std::string& the_tag)
throw (ObjectNotKnown,
DeletePrivilegeNotHeld,
FederateNotExecutionMember,
@@ -269,7 +269,7 @@
ObjectHandle,
AttributeHandle *,
UShort,
- const char *)
+ const std::string&)
throw (ObjectNotKnown,
AttributeNotDefined,
AttributeNotOwned,
@@ -316,7 +316,7 @@
ObjectHandle,
AttributeHandle *,
UShort,
- const char *)
+ const std::string&)
throw (ObjectNotKnown,
ObjectClassNotPublished,
@@ -461,4 +461,4 @@
}
} // namespace certi
-// $Id: ObjectSet.cc,v 3.26 2009/10/21 18:56:28 erk Exp $
+// $Id: ObjectSet.cc,v 3.27 2009/11/19 18:15:31 erk Exp $
Index: libCERTI/TreeNamedAndHandledSet.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/TreeNamedAndHandledSet.hh,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- libCERTI/TreeNamedAndHandledSet.hh 12 Oct 2009 07:09:32 -0000 1.9
+++ libCERTI/TreeNamedAndHandledSet.hh 19 Nov 2009 18:15:31 -0000 1.10
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: TreeNamedAndHandledSet.hh,v 1.9 2009/10/12 07:09:32 erk Exp $
+// $Id: TreeNamedAndHandledSet.hh,v 1.10 2009/11/19 18:15:31 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _TreeNamedAndHandledSet_HH
@@ -75,10 +75,10 @@
*/
typedef typename ObjectType::ObjectNotDefinedException
ObjectNotDefinedException;
- TreeNamedAndHandledSet(std::string setName,bool isRootSet=false);
+ TreeNamedAndHandledSet(const std::string& setName,bool isRootSet=false);
~TreeNamedAndHandledSet();
- std::string getSetName() const {return setName;};
+ const std::string& getSetName() const {return setName;};
/**
* Add an object to the set and build parent <--> child relationship.
@@ -98,7 +98,7 @@
* @return the handle corresponding to the given name
* @throw NameNotFound the name was not found in the set
*/
- HandleType getHandleFromName(const std::string name) const
+ HandleType getHandleFromName(const std::string& name) const
throw (NameNotFound);
/**
@@ -107,7 +107,7 @@
* @return the name corresponding to the given handle
* @throw NameNotFound the handle was not found in the set
*/
- std::string getNameFromHandle(HandleType handle) const
+ const std::string& getNameFromHandle(HandleType handle) const
throw (ObjectNotDefinedException);
/**
@@ -154,7 +154,7 @@
* the number of object in the set.
* @return the size of the set
*/
- const size_t size() {return fromName.size();}
+ size_t size() const {return fromName.size();}
protected:
Handle2ObjectMap_t fromHandle;
@@ -175,7 +175,7 @@
};
template <typename ObjectType>
-TreeNamedAndHandledSet<ObjectType>::TreeNamedAndHandledSet(std::string
theSetName, bool theIsRootSet) {
+TreeNamedAndHandledSet<ObjectType>::TreeNamedAndHandledSet(const std::string&
theSetName, bool theIsRootSet) {
this->setName = theSetName;
this->isRootSet = theIsRootSet;
} /* end of TreeNamedAndHandledSet (constructor) */
@@ -253,10 +253,9 @@
template <typename ObjectType>
typename TreeNamedAndHandledSet<ObjectType>::HandleType
-TreeNamedAndHandledSet<ObjectType>::getHandleFromName(std::string name) const
+TreeNamedAndHandledSet<ObjectType>::getHandleFromName(const std::string& name)
const
throw (NameNotFound) {
- named_const_iterator findit;
std::string sname;
std::string prefix;
@@ -279,7 +278,7 @@
* First try to find the named object
* This should be an efficient binary_search
*/
- findit = fromName.find(sname);
+ named_const_iterator findit = fromName.find(sname);
//std::cout << "Looking for " << sname << std::endl;
/* If found return the handle */
if (findit != fromName.end()) {
@@ -307,7 +306,7 @@
} /* end of getObjectClassHandle */
template <typename ObjectType>
-std::string
+const std::string&
TreeNamedAndHandledSet<ObjectType>::getNameFromHandle(HandleType handle) const
throw (ObjectNotDefinedException) {
Index: libCERTI/ObjectSet.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectSet.hh,v
retrieving revision 3.14
retrieving revision 3.15
diff -u -b -r3.14 -r3.15
--- libCERTI/ObjectSet.hh 7 Dec 2008 20:16:15 -0000 3.14
+++ libCERTI/ObjectSet.hh 19 Nov 2009 18:15:31 -0000 3.15
@@ -45,10 +45,10 @@
~ObjectSet();
ObjectHandle
- getObjectInstanceHandle(std::string) const
+ getObjectInstanceHandle(const std::string&) const
throw (ObjectNotKnown, RTIinternalError);
- const char *
+ const std::string&
getObjectInstanceName(ObjectHandle the_object) const
throw (ObjectNotKnown, RTIinternalError);
@@ -72,11 +72,11 @@
RTIinternalError, InvalidObjectHandle);
Object *registerObjectInstance(FederateHandle, ObjectClassHandle,
- ObjectHandle, std::string)
+ ObjectHandle, const std::string&)
throw (ObjectAlreadyRegistered, ConcurrentAccessAttempted,
SaveInProgress, RestoreInProgress, RTIinternalError);
- void deleteObjectInstance(FederateHandle, ObjectHandle, std::string tag)
+ void deleteObjectInstance(FederateHandle, ObjectHandle, const std::string&
tag)
throw (ObjectNotKnown, DeletePrivilegeNotHeld,
FederateNotExecutionMember, ConcurrentAccessAttempted,
SaveInProgress, RestoreInProgress, RTIinternalError);
@@ -105,7 +105,7 @@
ObjectHandle the_object,
AttributeHandle *the_attributes,
UShort the_size,
- const char *the_tag)
+ const std::string& the_tag)
throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
AttributeAlreadyBeingDivested, RTIinternalError);
@@ -131,7 +131,7 @@
ObjectHandle the_object,
AttributeHandle *the_attributes,
UShort the_size,
- const char *the_tag)
+ const std::string& the_tag)
throw (ObjectNotKnown, ObjectClassNotPublished, AttributeNotDefined,
AttributeNotPublished, FederateOwnsAttributes,
RTIinternalError);
Index: libCERTI/Parameter.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Parameter.hh,v
retrieving revision 3.7
retrieving revision 3.8
diff -u -b -r3.7 -r3.8
--- libCERTI/Parameter.hh 31 Aug 2007 12:47:40 -0000 3.7
+++ libCERTI/Parameter.hh 19 Nov 2009 18:15:31 -0000 3.8
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Parameter.hh,v 3.7 2007/08/31 12:47:40 erk Exp $
+// $Id: Parameter.hh,v 3.8 2009/11/19 18:15:31 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_PARAMETER_HH
@@ -37,7 +37,7 @@
{
public:
Parameter();
- Parameter(std::string);
+ Parameter(const std::string&);
void display();
@@ -54,4 +54,4 @@
#endif // CERTI_PARAMETER_HH
-// $Id: Parameter.hh,v 3.7 2007/08/31 12:47:40 erk Exp $
+// $Id: Parameter.hh,v 3.8 2009/11/19 18:15:31 erk Exp $
Index: libCERTI/SocketUDP.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/SocketUDP.cc,v
retrieving revision 3.25
retrieving revision 3.26
diff -u -b -r3.25 -r3.26
--- libCERTI/SocketUDP.cc 21 Oct 2009 18:56:28 -0000 3.25
+++ libCERTI/SocketUDP.cc 19 Nov 2009 18:15:31 -0000 3.26
@@ -115,7 +115,7 @@
<< "> with error <"
<< strerror(errno)
<< ">";
- throw NetworkError(msg.str().c_str());
+ throw NetworkError(msg.str());
}
#ifdef _WIN32
@@ -133,7 +133,7 @@
msg << "Cannot Open Socket open gave error < "
<< strerror(errno)
<< ">";
- throw NetworkError(msg.str().c_str());
+ throw NetworkError(msg.str());
}
if (!bind())
@@ -141,7 +141,7 @@
msg << "Cannot Bind Socket bind gave error < "
<< strerror(errno)
<< ">";
- throw NetworkError(msg.str().c_str());
+ throw NetworkError(msg.str());
}
// recuperation du port lie au socket _socket_udp
@@ -177,7 +177,7 @@
<< strerror(errno)
<< ">";
//perror("SocketUDP: gethostbyname");
- throw NetworkError(msg.str().c_str());
+ throw NetworkError(msg.str());
}
memcpy((char *) &sock_local.sin_addr,(char *)hp_local->h_addr,
hp_local->h_length);
Index: libCERTI/NetworkMessage.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage.hh,v
retrieving revision 3.50
retrieving revision 3.51
diff -u -b -r3.50 -r3.51
--- libCERTI/NetworkMessage.hh 18 Nov 2009 18:50:49 -0000 3.50
+++ libCERTI/NetworkMessage.hh 19 Nov 2009 18:15:31 -0000 3.51
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: NetworkMessage.hh,v 3.50 2009/11/18 18:50:49 erk Exp $
+// $Id: NetworkMessage.hh,v 3.51 2009/11/19 18:15:31 erk Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_NETWORK_MESSAGE_HH
@@ -225,17 +225,15 @@
* Indicate if the message is Labelled or not
*/
bool isLabelled() {return _isLabelled;};
- void setLabel(const std::string new_label) {_isLabelled = true; label =
new_label;};
- void setLabel(const char *new_label) {_isLabelled = true; label =
std::string(new_label); }
- const std::string getLabel() const {return this->label;};
+ void setLabel(const std::string& new_label) {_isLabelled = true; label
= new_label;}
+ const std::string& getLabel() const {return this->label;};
/**
* Indicate if the message is Tagged or not
*/
bool isTagged() {return _isTagged;};
- void setTag(const std::string new_tag) {_isTagged = true; tag =
new_tag;};
- void setTag(const char *new_tag) {_isTagged = true; tag =
std::string(new_tag); }
- const std::string getTag() const {return this->tag;};
+ void setTag(const std::string& new_tag) {_isTagged = true; tag =
new_tag;};
+ const std::string& getTag() const {return this->tag;};
void sizeValueArray(int size) ;
@@ -254,7 +252,7 @@
OrderType order ;
/** The name corresponding to message type */
- const std::string getName() const {return name;}
+ const std::string& getName() const {return name;}
/**
@@ -345,4 +343,4 @@
#endif // CERTI_NETWORK_MESSAGE_HH
-// $Id: NetworkMessage.hh,v 3.50 2009/11/18 18:50:49 erk Exp $
+// $Id: NetworkMessage.hh,v 3.51 2009/11/19 18:15:31 erk Exp $
Index: libCERTI/AuditFile.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/AuditFile.cc,v
retrieving revision 3.11
retrieving revision 3.12
diff -u -b -r3.11 -r3.12
--- libCERTI/AuditFile.cc 6 Jul 2007 09:25:18 -0000 3.11
+++ libCERTI/AuditFile.cc 19 Nov 2009 18:15:31 -0000 3.12
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: AuditFile.cc,v 3.11 2007/07/06 09:25:18 erk Exp $
+// $Id: AuditFile.cc,v 3.12 2009/11/19 18:15:31 erk Exp $
// ----------------------------------------------------------------------------
@@ -33,7 +33,6 @@
using std::ios ;
using std::cerr ;
using std::endl ;
-using std::string ;
namespace certi {
@@ -41,11 +40,11 @@
//! AuditFile constructor to write to file
/*! Audit file is used to store information about actions taken by the RTIG
*/
-AuditFile::AuditFile(const std::string logfile)
+AuditFile::AuditFile(const std::string& logfile)
: auditFile(logfile.c_str(), ios::app)
{
if (!auditFile.is_open()) {
- cerr << "Could not open Audit file � " << logfile.c_str()
+ cerr << "Could not open Audit file � " << logfile
<< " �." << endl ;
throw RTIinternalError("Could not open Audit file.");
}
@@ -72,7 +71,7 @@
current status and a comment. Then write line to file.
*/
void
-AuditFile::endLine(unsigned short event_status, std::string reason)
+AuditFile::endLine(unsigned short event_status, const std::string& reason)
{
if (currentLine.started())
currentLine.end(event_status, reason);
@@ -120,7 +119,7 @@
AuditFile::putLine(unsigned short event_type,
unsigned short event_level,
unsigned short event_status,
- std::string reason)
+ const std::string& reason)
{
if (event_level >= AUDIT_CURRENT_LEVEL) {
AuditLine line(event_type, event_level, event_status, reason);
@@ -169,6 +168,13 @@
}
AuditFile &
+AuditFile::operator<<(const std::string& s)
+{
+ currentLine.addComment(s);
+ return *this ;
+}
+
+AuditFile &
AuditFile::operator<<(int n)
{
std::ostringstream s ;
@@ -215,4 +221,4 @@
}
-// $Id: AuditFile.cc,v 3.11 2007/07/06 09:25:18 erk Exp $
+// $Id: AuditFile.cc,v 3.12 2009/11/19 18:15:31 erk Exp $
Index: libCERTI/ObjectClassSet.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.cc,v
retrieving revision 3.47
retrieving revision 3.48
diff -u -b -r3.47 -r3.48
--- libCERTI/ObjectClassSet.cc 21 Oct 2009 20:04:46 -0000 3.47
+++ libCERTI/ObjectClassSet.cc 19 Nov 2009 18:15:31 -0000 3.48
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassSet.cc,v 3.47 2009/10/21 20:04:46 erk Exp $
+// $Id: ObjectClassSet.cc,v 3.48 2009/11/19 18:15:31 erk Exp $
// ----------------------------------------------------------------------------
// Project
@@ -37,7 +37,6 @@
using std::list ;
using std::endl ;
-using std::string ;
namespace certi {
@@ -74,7 +73,7 @@
ObjectClassSet::deleteObject(FederateHandle federate,
ObjectHandle object,
FederationTime theTime,
- std::string tag)
+ const std::string& tag)
throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError)
{
// It may throw ObjectNotKnown
@@ -116,7 +115,7 @@
void
ObjectClassSet::deleteObject(FederateHandle federate,
ObjectHandle object,
- std::string tag)
+ const std::string& tag)
throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError)
{
// It may throw ObjectNotKnown
@@ -158,7 +157,7 @@
// ----------------------------------------------------------------------------
//! getAttributeHandle.
AttributeHandle
-ObjectClassSet::getAttributeHandle(const char *the_name,
+ObjectClassSet::getAttributeHandle(const std::string& the_name,
ObjectClassHandle the_class) const
throw (NameNotFound, ObjectClassNotDefined, RTIinternalError)
{
@@ -167,11 +166,11 @@
ObjectClass *objectClass = 0 ;
AttributeHandle handle ;
- if (the_name == 0)
+ if (the_name.empty())
throw RTIinternalError("name is null");
D.Out(pdRequest, "Looking for attribute \"%s\" of class %u...",
- the_name, the_class);
+ the_name.c_str(), the_class);
// It may throw ObjectClassNotDefined.
objectClass = getObjectFromHandle(the_class);
@@ -192,7 +191,7 @@
// ----------------------------------------------------------------------------
//! getAttributeName.
-const char *
+const std::string&
ObjectClassSet::getAttributeName(AttributeHandle the_handle,
ObjectClassHandle the_class) const
throw (AttributeNotDefined,
@@ -251,14 +250,14 @@
// ----------------------------------------------------------------------------
//! getObjectClassHandle.
ObjectClassHandle
-ObjectClassSet::getObjectClassHandle(std::string class_name) const
+ObjectClassSet::getObjectClassHandle(const std::string& class_name) const
throw (NameNotFound){
return getHandleFromName(class_name);
} /* end of getObjectClassHandle */
// ----------------------------------------------------------------------------
//! getObjectClassName.
-string
+const std::string&
ObjectClassSet::getObjectClassName(ObjectClassHandle the_handle) const
throw (ObjectClassNotDefined)
{
@@ -420,7 +419,7 @@
std::vector <AttributeValue_t> &values,
UShort nb,
FederationTime time,
- const char *tag)
+ const std::string& tag)
throw (ObjectNotKnown,
AttributeNotDefined,
AttributeNotOwned,
@@ -465,7 +464,7 @@
std::vector <AttributeHandle>
&attributes,
std::vector <AttributeValue_t> &values,
UShort nb,
- const char *tag)
+ const std::string& tag)
throw (ObjectNotKnown,
AttributeNotDefined,
AttributeNotOwned,
@@ -510,7 +509,7 @@
ObjectHandle theObjectHandle,
std::vector <AttributeHandle>
&theAttributeList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (ObjectNotKnown,
AttributeNotDefined,
AttributeNotOwned,
@@ -625,7 +624,7 @@
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
UShort theListSize,
- const char *theTag)
+ const std::string& theTag)
throw (ObjectNotKnown,
ObjectClassNotPublished,
AttributeNotDefined,
@@ -692,4 +691,4 @@
} // namespace certi
-// $Id: ObjectClassSet.cc,v 3.47 2009/10/21 20:04:46 erk Exp $
+// $Id: ObjectClassSet.cc,v 3.48 2009/11/19 18:15:31 erk Exp $
Index: libCERTI/InteractionSet.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/InteractionSet.cc,v
retrieving revision 3.29
retrieving revision 3.30
diff -u -b -r3.29 -r3.30
--- libCERTI/InteractionSet.cc 21 Oct 2009 18:56:28 -0000 3.29
+++ libCERTI/InteractionSet.cc 19 Nov 2009 18:15:31 -0000 3.30
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: InteractionSet.cc,v 3.29 2009/10/21 18:56:28 erk Exp $
+// $Id: InteractionSet.cc,v 3.30 2009/11/19 18:15:31 erk Exp $
// ----------------------------------------------------------------------------
#include "Interaction.hh"
@@ -68,7 +68,7 @@
UShort list_size,
FederationTime the_time,
const RTIRegion *region,
- const char *the_tag)
+ const std::string& the_tag)
throw (FederateNotPublishing,
InteractionClassNotDefined,
InteractionParameterNotDefined,
@@ -116,7 +116,7 @@
std::vector <ParameterValue_t> &value_list,
UShort list_size,
const RTIRegion *region,
- const char *the_tag)
+ const std::string& the_tag)
throw (FederateNotPublishing,
InteractionClassNotDefined,
InteractionParameterNotDefined,
@@ -163,25 +163,22 @@
// ----------------------------------------------------------------------------
//! Return the interaction name associated to handle.
-std::string
+const std::string&
InteractionSet::getInteractionClassName(InteractionClassHandle the_handle)
const
throw (InteractionClassNotDefined)
{
- return getNameFromHandle(+the_handle);
+ return getNameFromHandle(the_handle);
} /* end of getInteractionClassName */
// ----------------------------------------------------------------------------
//! Return the parameter handle associated to name and class handle.
ParameterHandle
-InteractionSet::getParameterHandle(const char *the_name,
+InteractionSet::getParameterHandle(const std::string& the_name,
InteractionClassHandle the_class)
throw (NameNotFound,
InteractionClassNotDefined,
RTIinternalError)
{
- if (the_name == NULL)
- throw RTIinternalError("");
-
// It may throw InteractionClassNotDefined
Interaction *interaction = getObjectFromHandle(the_class);
return interaction->getParameterHandle(the_name);
@@ -275,4 +272,4 @@
} // namespace certi
-// $Id: InteractionSet.cc,v 3.29 2009/10/21 18:56:28 erk Exp $
+// $Id: InteractionSet.cc,v 3.30 2009/11/19 18:15:31 erk Exp $
Index: libCERTI/Message.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message.cc,v
retrieving revision 3.63
retrieving revision 3.64
diff -u -b -r3.63 -r3.64
--- libCERTI/Message.cc 2 Apr 2009 19:58:07 -0000 3.63
+++ libCERTI/Message.cc 19 Nov 2009 18:15:31 -0000 3.64
@@ -97,14 +97,14 @@
@param NewLabel copied (strcpy) into Message label (NULL label is stored
as an empty string)
*/
void
-Message::setLabel(std::string NewLabel)
+Message::setLabel(const std::string& NewLabel)
{
label = NewLabel ;
}
// ----------------------------------------------------------------------------
void
-Message::setName(const char *NewName)
+Message::setName(const std::string& NewName)
{
name = NewName ;
}
@@ -447,7 +447,7 @@
// ----------------------------------------------------------------------------
//! Sets the federation name.
-void Message::setFederationName(std::string NewNomFederation)
+void Message::setFederationName(const std::string& NewNomFederation)
{
federationName = NewNomFederation ;
}
@@ -457,7 +457,7 @@
// setFederateName
//
void
-Message::setFederateName(std::string NewNomFedere)
+Message::setFederateName(const std::string& NewNomFedere)
{
federateName = NewNomFedere ;
}
@@ -468,7 +468,7 @@
@param new_tag tag
*/
void
-Message::setTag(std::string new_tag)
+Message::setTag(const std::string& new_tag)
{
tag = new_tag ;
}
@@ -477,7 +477,7 @@
// setFEDid
//
void
-Message::setFEDid(std::string NewFEDid)
+Message::setFEDid(const std::string& NewFEDid)
{
FEDid = NewFEDid;
}
Index: libCERTI/MessageBuffer.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/MessageBuffer.cc,v
retrieving revision 3.15
retrieving revision 3.16
diff -u -b -r3.15 -r3.16
--- libCERTI/MessageBuffer.cc 21 Oct 2009 20:13:37 -0000 3.15
+++ libCERTI/MessageBuffer.cc 19 Nov 2009 18:15:31 -0000 3.16
@@ -209,7 +209,7 @@
<< "> inside a buffer of readable size <"
<< (int32_t)writeOffset-readOffset << ">
(writeOffset="
<<writeOffset << ",readOffset="<<readOffset
<<").";
- throw RTIinternalError(smsg.str().c_str());
+ throw RTIinternalError(smsg.str());
}
memcpy(data, buffer+readOffset, n);
@@ -253,7 +253,7 @@
<< "> inside a buffer of readable size <"
<< (int32_t)writeOffset-readOffset << ">
(writeOffset="
<<writeOffset << ",readOffset="<<readOffset
<<").";
- throw RTIinternalError(smsg.str().c_str());
+ throw RTIinternalError(smsg.str());
}
/* do not swap byte if it is not necessary */
@@ -307,7 +307,7 @@
<< "> inside a buffer of readable size <"
<< (int32_t)writeOffset-readOffset << ">
(writeOffset="
<<writeOffset << ",readOffset="<<readOffset
<<").";
- throw RTIinternalError(smsg.str().c_str());
+ throw RTIinternalError(smsg.str());
}
/* do not swap byte if it is not necessary */
@@ -374,7 +374,7 @@
<< "> inside a buffer of readable size <"
<< (int32_t)writeOffset-readOffset << ">
(writeOffset="
<<writeOffset << ",readOffset="<<readOffset
<<").";
- throw RTIinternalError(smsg.str().c_str());
+ throw RTIinternalError(smsg.str());
}
/* do not swap byte if it is not necessary */
Index: libCERTI/XmlParser.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/XmlParser.cc,v
retrieving revision 3.31
retrieving revision 3.32
diff -u -b -r3.31 -r3.32
--- libCERTI/XmlParser.cc 21 Oct 2009 20:04:46 -0000 3.31
+++ libCERTI/XmlParser.cc 19 Nov 2009 18:15:31 -0000 3.32
@@ -283,7 +283,7 @@
while (cur != NULL) {
if ((!xmlStrcmp(cur->name, NODE_PARAMETER))) {
Parameter *param = new Parameter();
- param->setName(CleanXmlGetProp(cur,ATTRIBUTE_NAME));
+ param->setName(std::string(CleanXmlGetProp(cur,ATTRIBUTE_NAME)));
param->setHandle(freeParameterHandle++);
current->addParameter(param);
}
@@ -306,14 +306,14 @@
xmlNodePtr prev = cur ;
RoutingSpace current ;
current.setHandle(freeSpaceHandle++);
- current.setName(CleanXmlGetProp(cur,ATTRIBUTE_NAME));
+ current.setName(std::string(CleanXmlGetProp(cur,ATTRIBUTE_NAME)));
// Dimensions
cur = cur->xmlChildrenNode ;
while (cur != NULL) {
if ((!xmlStrcmp(cur->name, NODE_DIMENSION))) {
Dimension dimension(freeDimensionHandle++);
- dimension.setName(CleanXmlGetProp(cur,ATTRIBUTE_NAME));
+
dimension.setName(std::string(CleanXmlGetProp(cur,ATTRIBUTE_NAME)));
current.addDimension(dimension);
}
cur = cur->next ;
Index: libCERTI/Named.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Named.cc,v
retrieving revision 3.9
retrieving revision 3.10
diff -u -b -r3.9 -r3.10
--- libCERTI/Named.cc 11 Oct 2009 14:55:01 -0000 3.9
+++ libCERTI/Named.cc 19 Nov 2009 18:15:32 -0000 3.10
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Named.cc,v 3.9 2009/10/11 14:55:01 erk Exp $
+// $Id: Named.cc,v 3.10 2009/11/19 18:15:32 erk Exp $
// ----------------------------------------------------------------------------
#include "Named.hh"
@@ -39,11 +39,6 @@
name = newName ;
}
-void
-Named::setName(const char* newName) {
- name = newName;
-}
-
const std::string&
Named::getName() const
{
@@ -51,12 +46,6 @@
}
-const char *
-Named::getCName() const
-{
- return name.c_str();
-}
-
bool
Named::isNamed(const std::string &newName) const
{
@@ -94,7 +83,7 @@
} /* end of getNextClassName */
std::string
-Named::getLeafClassName(std::string qualifiedClassName) {
+Named::getLeafClassName(const std::string& qualifiedClassName) {
size_t idx = 0;
/* take the substring from '.' (excluded) until the end */
idx = qualifiedClassName.find_last_of('.');
@@ -103,4 +92,4 @@
} // certi
-// $Id: Named.cc,v 3.9 2009/10/11 14:55:01 erk Exp $
+// $Id: Named.cc,v 3.10 2009/11/19 18:15:32 erk Exp $
Index: libCERTI/AuditLine.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/AuditLine.cc,v
retrieving revision 3.11
retrieving revision 3.12
diff -u -b -r3.11 -r3.12
--- libCERTI/AuditLine.cc 6 Jul 2007 09:25:17 -0000 3.11
+++ libCERTI/AuditLine.cc 19 Nov 2009 18:15:32 -0000 3.12
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: AuditLine.cc,v 3.11 2007/07/06 09:25:17 erk Exp $
+// $Id: AuditLine.cc,v 3.12 2009/11/19 18:15:32 erk Exp $
// ----------------------------------------------------------------------------
@@ -28,11 +28,9 @@
#include "certi.hh"
#include <string>
-#include <time.h>
using std::ofstream ;
using std::endl ;
-using std::string ;
namespace certi {
@@ -51,7 +49,7 @@
/*!
*/
AuditLine::AuditLine(unsigned short event_type, unsigned short event_level,
- unsigned short event_status, std::string reason)
+ unsigned short event_status, const std::string& reason)
: federation(0), federate(0),
type(event_type), level(event_level), status(event_status),
modified(false), date(0), comment(reason)
@@ -76,7 +74,7 @@
// ----------------------------------------------------------------------------
//! Finish the line with a status and reason
void
-AuditLine::end(unsigned short event_status, const std::string reason)
+AuditLine::end(unsigned short event_status, const std::string& reason)
{
status = event_status ;
addComment(reason);
@@ -127,5 +125,5 @@
} // namespace certi
-// $Id: AuditLine.cc,v 3.11 2007/07/06 09:25:17 erk Exp $
+// $Id: AuditLine.cc,v 3.12 2009/11/19 18:15:32 erk Exp $
Index: libCERTI/ObjectClassAttribute.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassAttribute.cc,v
retrieving revision 3.34
retrieving revision 3.35
diff -u -b -r3.34 -r3.35
--- libCERTI/ObjectClassAttribute.cc 18 Nov 2009 18:50:49 -0000 3.34
+++ libCERTI/ObjectClassAttribute.cc 19 Nov 2009 18:15:32 -0000 3.35
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassAttribute.cc,v 3.34 2009/11/18 18:50:49 erk Exp $
+// $Id: ObjectClassAttribute.cc,v 3.35 2009/11/19 18:15:32 erk Exp $
// ----------------------------------------------------------------------------
#include "ObjectClassAttribute.hh"
@@ -40,7 +40,7 @@
static PrettyDebug D("OBJECTCLASSATTRIBUTE", "(Obj.Cl.Attr) ");
-ObjectClassAttribute::ObjectClassAttribute(const std::string theName,
TransportType theTransport, OrderType theOrder)
+ObjectClassAttribute::ObjectClassAttribute(const std::string& theName,
TransportType theTransport, OrderType theOrder)
: level(PublicLevelID), order(theOrder), transport(theTransport), server(0),
handle(0), space(0) {
setName(theName);
@@ -83,7 +83,7 @@
*/
void
ObjectClassAttribute::checkFederateAccess(FederateHandle fed,
- const char *reason) const
+ const std::string& reason) const
{
if (server && !server->canFederateAccessData(fed, level)) {
cout << "Attribute " << handle << " : SecurityError for federate "
@@ -219,4 +219,4 @@
} // namespace
-// $Id: ObjectClassAttribute.cc,v 3.34 2009/11/18 18:50:49 erk Exp $
+// $Id: ObjectClassAttribute.cc,v 3.35 2009/11/19 18:15:32 erk Exp $
Index: libCERTI/RootObject.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/RootObject.hh,v
retrieving revision 3.33
retrieving revision 3.34
diff -u -b -r3.33 -r3.34
--- libCERTI/RootObject.hh 18 Nov 2009 18:50:49 -0000 3.33
+++ libCERTI/RootObject.hh 19 Nov 2009 18:15:32 -0000 3.34
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: RootObject.hh,v 3.33 2009/11/18 18:50:49 erk Exp $
+// $Id: RootObject.hh,v 3.34 2009/11/19 18:15:32 erk Exp $
// ----------------------------------------------------------------------------
#ifndef LIBCERTI_ROOT_OBJECT
@@ -95,8 +95,8 @@
// Data Distribution Management
void addRoutingSpace(const RoutingSpace &);
RoutingSpace &getRoutingSpace(SpaceHandle) throw (SpaceNotDefined);
- SpaceHandle getRoutingSpaceHandle(std::string) throw (NameNotFound);
- std::string getRoutingSpaceName(SpaceHandle) throw (SpaceNotDefined);
+ SpaceHandle getRoutingSpaceHandle(const std::string&) throw (NameNotFound);
+ const std::string& getRoutingSpaceName(SpaceHandle) throw
(SpaceNotDefined);
void addRegion(RTIRegion *);
RegionHandle createRegion(SpaceHandle, unsigned long) throw
(SpaceNotDefined);
@@ -107,7 +107,7 @@
// Object Management
void registerObjectInstance(FederateHandle, ObjectClassHandle,
ObjectHandle,
- const char *)
+ const std::string&)
throw (InvalidObjectHandle,
ObjectClassNotDefined,
ObjectClassNotPublished,
@@ -118,10 +118,10 @@
throw (ObjectNotKnown);
void deleteObjectInstance(FederateHandle, ObjectHandle,
- FederationTime theTime, std::string theTag)
+ FederationTime theTime, const std::string& theTag)
throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError);
- void deleteObjectInstance(FederateHandle, ObjectHandle, std::string theTag)
+ void deleteObjectInstance(FederateHandle, ObjectHandle, const std::string&
theTag)
throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError);
void killFederate(FederateHandle) throw (RTIinternalError);
@@ -194,4 +194,4 @@
#endif // LIBCERTI_ROOT_OBJECT
-// $Id: RootObject.hh,v 3.33 2009/11/18 18:50:49 erk Exp $
+// $Id: RootObject.hh,v 3.34 2009/11/19 18:15:32 erk Exp $
Index: libCERTI/SocketUN.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/SocketUN.cc,v
retrieving revision 3.32
retrieving revision 3.33
diff -u -b -r3.32 -r3.33
--- libCERTI/SocketUN.cc 21 Oct 2009 18:56:28 -0000 3.32
+++ libCERTI/SocketUN.cc 19 Nov 2009 18:15:32 -0000 3.33
@@ -292,7 +292,7 @@
<< strerror(errno)
<< "> msg = <"
<< msg <<">";
- throw NetworkError(smsg.str().c_str());
+ throw NetworkError(smsg.str());
}
// ----------------------------------------------------------------------------
Index: libCERTI/Clock.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Clock.cc,v
retrieving revision 4.4
retrieving revision 4.5
diff -u -b -r4.4 -r4.5
--- libCERTI/Clock.cc 23 Jun 2008 13:25:05 -0000 4.4
+++ libCERTI/Clock.cc 19 Nov 2009 18:15:32 -0000 4.5
@@ -20,7 +20,7 @@
#include "Clock.hh"
namespace certi {
-Clock::Clock(const std::string newName)
+Clock::Clock(const std::string& newName)
{
name = newName;
}
Index: libCERTI/AuditFile.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/AuditFile.hh,v
retrieving revision 3.10
retrieving revision 3.11
diff -u -b -r3.10 -r3.11
--- libCERTI/AuditFile.hh 22 Jun 2007 08:51:36 -0000 3.10
+++ libCERTI/AuditFile.hh 19 Nov 2009 18:15:32 -0000 3.11
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: AuditFile.hh,v 3.10 2007/06/22 08:51:36 erk Exp $
+// $Id: AuditFile.hh,v 3.11 2009/11/19 18:15:32 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_AUDIT_FILE_HH
@@ -57,17 +57,18 @@
class CERTI_EXPORT AuditFile
{
public:
- AuditFile(const std::string); // Open LogFileName for writing.
+ AuditFile(const std::string&); // Open LogFileName for writing.
~AuditFile();
void startLine(Handle, FederateHandle, unsigned short EventType);
void setLevel(unsigned short EventLevel);
// void addToLine(const std::string);
// void addToLinef(const char *Format, ...);
- void endLine(unsigned short, std::string);
- void putLine(unsigned short, unsigned short, unsigned short, std::string);
+ void endLine(unsigned short, const std::string&);
+ void putLine(unsigned short, unsigned short, unsigned short, const
std::string&);
AuditFile &operator<<(const char *);
+ AuditFile &operator<<(const std::string& s);
AuditFile &operator<<(int);
AuditFile &operator<<(unsigned int);
AuditFile &operator<<(long);
@@ -84,4 +85,4 @@
#endif // _CERTI_AUDIT_FILE_HH
-// $Id: AuditFile.hh,v 3.10 2007/06/22 08:51:36 erk Exp $
+// $Id: AuditFile.hh,v 3.11 2009/11/19 18:15:32 erk Exp $
Index: libCERTI/Message.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message.hh,v
retrieving revision 3.55
retrieving revision 3.56
diff -u -b -r3.55 -r3.56
--- libCERTI/Message.hh 2 Apr 2009 19:58:08 -0000 3.55
+++ libCERTI/Message.hh 19 Nov 2009 18:15:32 -0000 3.56
@@ -272,24 +272,24 @@
// containing the actual Attrib/Param values.
std::vector <AttributeValue_t> getValueArray();
- std::string getLabel() const { return label ; };
- void setLabel(std::string new_label);
+ const std::string& getLabel() const { return label ; };
+ void setLabel(const std::string& new_label);
//const char *getName() const { return name ; };
- const std::string getName() const {return name;}
- void setName(const char *new_name);
+ const std::string& getName() const {return name;}
+ void setName(const std::string& new_name);
DimensionHandle getDimension() const { return dimension ; };
void setDimension(DimensionHandle);
- std::string getFederationName() const { return federationName ; };
- void setFederationName(std::string federation_name);
+ const std::string& getFederationName() const { return federationName ; };
+ void setFederationName(const std::string& federation_name);
- std::string getFederateName() const { return federateName ; };
- void setFederateName(std::string federate_name);
+ const std::string& getFederateName() const { return federateName ; };
+ void setFederateName(const std::string& federate_name);
- std::string getTag() const { return tag ; };
- void setTag(std::string new_tag);
+ const std::string& getTag() const { return tag ; };
+ void setTag(const std::string& new_tag);
SpaceHandle getSpace() const { return space ; };
void setSpace(SpaceHandle);
@@ -377,8 +377,8 @@
TypeException getExceptionType() const { return exception ; };
const char *getExceptionReason() const { return exceptionReason.c_str() ;
};
- std::string getFEDid() const { return FEDid ; };
- void setFEDid(std::string FEDid);
+ const std::string& getFEDid() const { return FEDid ; };
+ void setFEDid(const std::string& FEDid);
void displayvalueArray(char *);
Index: libCERTI/Message_R.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message_R.cc,v
retrieving revision 3.35
retrieving revision 3.36
diff -u -b -r3.35 -r3.36
--- libCERTI/Message_R.cc 21 Oct 2009 20:04:46 -0000 3.35
+++ libCERTI/Message_R.cc 19 Nov 2009 18:15:32 -0000 3.36
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Message_R.cc,v 3.35 2009/10/21 20:04:46 erk Exp $
+// $Id: Message_R.cc,v 3.36 2009/11/19 18:15:32 erk Exp $
// ----------------------------------------------------------------------------
@@ -63,7 +63,7 @@
/* We serialize the common Message part
* ALL Messages will contain the following
*/
- Debug(D, pdDebug) << "Deserialize <" <<
getName().c_str()<<">"<<std::endl;
+ Debug(D, pdDebug) << "Deserialize <" << getName()<<">"<<std::endl;
readHeader(msgBuffer);
readBody(msgBuffer) ;
G.Out(pdGendoc,"exit Message::deserialize");
@@ -649,4 +649,4 @@
} // namespace certi
-// $Id: Message_R.cc,v 3.35 2009/10/21 20:04:46 erk Exp $
+// $Id: Message_R.cc,v 3.36 2009/11/19 18:15:32 erk Exp $
Index: libCERTI/Clock.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Clock.hh,v
retrieving revision 4.9
retrieving revision 4.10
diff -u -b -r4.9 -r4.10
--- libCERTI/Clock.hh 25 Nov 2008 15:13:58 -0000 4.9
+++ libCERTI/Clock.hh 19 Nov 2009 18:15:32 -0000 4.10
@@ -44,12 +44,12 @@
* The Clock default constructor.
* @param[in] newName the clock name
*/
- Clock(const std::string newName);
+ Clock(const std::string& newName);
/**
* Get the clock name.
* @return the clock name
*/
- const std::string getName() const {return name;};
+ const std::string& getName() const {return name;};
/**
* Get the clock resolution in nano-seconds.
* @return the clock resolution in nano-seconds
Index: libCERTI/RootObject.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/RootObject.cc,v
retrieving revision 3.43
retrieving revision 3.44
diff -u -b -r3.43 -r3.44
--- libCERTI/RootObject.cc 18 Nov 2009 18:50:49 -0000 3.43
+++ libCERTI/RootObject.cc 19 Nov 2009 18:15:32 -0000 3.44
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: RootObject.cc,v 3.43 2009/11/18 18:50:49 erk Exp $
+// $Id: RootObject.cc,v 3.44 2009/11/19 18:15:32 erk Exp $
// ----------------------------------------------------------------------------
#include "Object.hh"
@@ -39,14 +39,12 @@
#include <string>
#include <stdio.h>
-#include <cstring>
#include <cassert>
#include <algorithm>
using std::vector ;
using std::cout ;
using std::endl ;
-using std::string ;
using std::list ;
@@ -93,7 +91,7 @@
SecurityLevelID
RootObject::getSecurityLevelID(const std::string& levelName)
{
- return server ? server->getLevelIDWithName(levelName.c_str()) :
PublicLevelID;
+ return server ? server->getLevelIDWithName(levelName) : PublicLevelID;
}
// ----------------------------------------------------------------------------
@@ -103,7 +101,7 @@
SecurityLevelID the_level_id)
{
if (server != NULL)
- server->registerFederate(the_federate.c_str(), the_level_id);
+ server->registerFederate(the_federate, the_level_id);
}
// ----------------------------------------------------------------------------
@@ -121,7 +119,7 @@
// ----------------------------------------------------------------------------
//! get a routing space handle
SpaceHandle
-RootObject::getRoutingSpaceHandle(std::string rs)
+RootObject::getRoutingSpaceHandle(const std::string& rs)
throw (NameNotFound)
{
vector<RoutingSpace>::const_iterator i = std::find_if(
@@ -135,7 +133,7 @@
// ----------------------------------------------------------------------------
//! get a routing space name
-string
+const std::string&
RootObject::getRoutingSpaceName(SpaceHandle handle)
throw (SpaceNotDefined)
{
@@ -235,7 +233,7 @@
RootObject::registerObjectInstance(FederateHandle the_federate,
ObjectClassHandle the_class,
ObjectHandle the_object,
- const char *the_object_name)
+ const std::string& the_object_name)
throw (InvalidObjectHandle,
ObjectClassNotDefined,
ObjectClassNotPublished,
@@ -267,7 +265,7 @@
RootObject::deleteObjectInstance(FederateHandle the_federate,
ObjectHandle the_object,
FederationTime theTime,
- std::string the_tag)
+ const std::string& the_tag)
throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError)
{
ObjectClasses->deleteObject(the_federate, the_object, theTime, the_tag);
@@ -278,7 +276,7 @@
void
RootObject::deleteObjectInstance(FederateHandle the_federate,
ObjectHandle the_object,
- std::string the_tag)
+ const std::string& the_tag)
throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError)
{
ObjectClasses->deleteObject(the_federate, the_object, the_tag);
@@ -563,7 +561,7 @@
if (parent) {
const Interaction::ParameterList_t& parameterList =
parent->getParameterList();
- for
(Interaction::Interaction::ParameterList_t::const_iterator j =
parameterList.begin();
+ for (Interaction::ParameterList_t::const_iterator j =
parameterList.begin();
j != parameterList.end(); ++j) {
current->addParameter(new Parameter(**j));
}
@@ -583,4 +581,4 @@
} // namespace certi
-// $Id: RootObject.cc,v 3.43 2009/11/18 18:50:49 erk Exp $
+// $Id: RootObject.cc,v 3.44 2009/11/19 18:15:32 erk Exp $
Index: libRTI/RTIambassador.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTIambassador.cc,v
retrieving revision 3.109
retrieving revision 3.110
diff -u -b -r3.109 -r3.110
--- libRTI/RTIambassador.cc 21 Oct 2009 20:04:46 -0000 3.109
+++ libRTI/RTIambassador.cc 19 Nov 2009 18:15:32 -0000 3.110
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: RTIambassador.cc,v 3.109 2009/10/21 20:04:46 erk Exp $
+// $Id: RTIambassador.cc,v 3.110 2009/11/19 18:15:32 erk Exp $
// ----------------------------------------------------------------------------
#include "RTI.hh"
@@ -39,6 +39,7 @@
#else
#include <unistd.h>
#endif
+#include <cstdlib>
#include <iostream>
#include <signal.h>
#include <cassert>
@@ -202,7 +203,7 @@
msg << "CreateProcess - GetLastError()=<"
<< GetLastError() <<"> "
<< "Cannot connect to RTIA.exe";
- throw RTI::RTIinternalError( msg.str().c_str());
+ throw RTI::RTIinternalError(msg.str().c_str());
}
privateRefs->handle_RTIA = pi.hProcess;
@@ -1160,7 +1161,7 @@
{
throw RTI::RTIinternalError ("Calling sendInteraction with Tag NULL") ;
}
- req.setTag((std::string)theTag);
+ req.setTag(std::string(theTag));
req.setPHVPS(certi_cast<ParameterHandleValuePairSetImp>()(theParameters).getParameterHandleValuePairs());
req.setRegion(0);
req.setBoolean(true);
@@ -1196,7 +1197,7 @@
{
throw RTI::RTIinternalError ("Calling sendIntercation with Tag NULL") ;
}
- req.setTag((std::string)theTag);
+ req.setTag(std::string(theTag));
req.setPHVPS(certi_cast<ParameterHandleValuePairSetImp>()(theParameters).getParameterHandleValuePairs());
req.setRegion(0);
req.setBoolean(false);
@@ -1607,7 +1608,7 @@
privateRefs->executeService(&req, &rep);
- return ((strcmp((rep.getTag()).c_str(), "RTI_TRUE") == 0) ? RTI_TRUE :
RTI_FALSE);
+ return (rep.getTag() == "RTI_TRUE") ? RTI_TRUE : RTI_FALSE;
}
// ----------------------------------------------------------------------------
@@ -3031,4 +3032,4 @@
privateRefs->executeService(&req, &rep);
}
-// $Id: RTIambassador.cc,v 3.109 2009/10/21 20:04:46 erk Exp $
+// $Id: RTIambassador.cc,v 3.110 2009/11/19 18:15:32 erk Exp $
Index: libRTI/RTIambPrivateRefs.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTIambPrivateRefs.cc,v
retrieving revision 3.21
retrieving revision 3.22
diff -u -b -r3.21 -r3.22
--- libRTI/RTIambPrivateRefs.cc 21 Oct 2009 20:04:46 -0000 3.21
+++ libRTI/RTIambPrivateRefs.cc 19 Nov 2009 18:15:32 -0000 3.22
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: RTIambPrivateRefs.cc,v 3.21 2009/10/21 20:04:46 erk Exp $
+// $Id: RTIambPrivateRefs.cc,v 3.22 2009/11/19 18:15:32 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -913,4 +913,4 @@
}
}
-// $Id: RTIambPrivateRefs.cc,v 3.21 2009/10/21 20:04:46 erk Exp $
+// $Id: RTIambPrivateRefs.cc,v 3.22 2009/11/19 18:15:32 erk Exp $
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [certi-cvs] certi RTIG/FederationsList.cc RTIG/Federate.cc ...,
certi-cvs <=