certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi/test/testFederate CMakeLists.txt testFede...


From: CERTI CVS commits
Subject: [certi-cvs] certi/test/testFederate CMakeLists.txt testFede...
Date: Fri, 07 Mar 2014 18:01:22 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Eric NOULARD <erk>      14/03/07 18:01:22

Modified files:
        test/testFederate: CMakeLists.txt testFederate.hh 
Added files:
        test/testFederate: testFederate-IEEE1516_2010.cc 

Log message:
        Prepare IEEE-1516-2010 test

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/test/testFederate/CMakeLists.txt?cvsroot=certi&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/certi/test/testFederate/testFederate.hh?cvsroot=certi&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/certi/test/testFederate/testFederate-IEEE1516_2010.cc?cvsroot=certi&rev=1.1

Patches:
Index: CMakeLists.txt
===================================================================
RCS file: /sources/certi/certi/test/testFederate/CMakeLists.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- CMakeLists.txt      3 Mar 2014 14:29:32 -0000       1.1
+++ CMakeLists.txt      7 Mar 2014 18:01:22 -0000       1.2
@@ -69,6 +69,19 @@
     LIBRARY DESTINATION lib
     ARCHIVE DESTINATION lib)
 
+if(NOT_READY)
+## IEEE1516_2010 specific code follow
+set(FEDERATE_TARGETNAME "CertiTestFederate-IEEE1516_2010")
+add_executable(${FEDERATE_TARGETNAME} ${testFederate_SRCS} 
testFederate-IEEE1516_2010.cc)
+set_target_properties(${FEDERATE_TARGETNAME} PROPERTIES COMPILE_FLAGS 
"-DIEEE1516_2010")
+target_include_directories(${FEDERATE_TARGETNAME} PUBLIC 
${CMAKE_SOURCE_DIR}/include/ieee1516-2010 
${CMAKE_BINARY_DIR}/include/ieee1516-2010)
+target_link_libraries(${FEDERATE_TARGETNAME} RTI1516e)
+install(TARGETS ${FEDERATE_TARGETNAME}
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib)
+endif()
+
 
 # DTest script not ready [yet]
 #install(FILES  

Index: testFederate.hh
===================================================================
RCS file: /sources/certi/certi/test/testFederate/testFederate.hh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- testFederate.hh     3 Mar 2014 14:29:33 -0000       1.1
+++ testFederate.hh     7 Mar 2014 18:01:22 -0000       1.2
@@ -52,7 +52,7 @@
 #elif IEEE1516_2000
     virtual ~testFederate() throw ()
 #elif IEEE1516_2010
-    virtual ~testFederate() throw (RTI::FederateInternalError)
+    virtual ~testFederate() throw ()
 #endif
                     {if (NULL != rtiAmb) delete rtiAmb;};
 

Index: testFederate-IEEE1516_2010.cc
===================================================================
RCS file: testFederate-IEEE1516_2010.cc
diff -N testFederate-IEEE1516_2010.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testFederate-IEEE1516_2010.cc       7 Mar 2014 18:01:22 -0000       1.1
@@ -0,0 +1,69 @@
+/*
+ * Following code is IEEE-1516_2010 specific
+ */
+#ifndef IEEE1516_2010
+#define IEEE1516_2010
+#endif
+
+#include "testFederate.hh"
+
+#include <iostream>
+
+bool testFederate::createFederationExecution(std::wstring federationName, 
std::wstring FOMFile) {
+    this->federationName = federationName;
+    this->FOMFile        = FOMFile;
+
+    try {
+        rtiAmb->createFederationExecution(federationName,FOMFile);
+    } catch (rti1516e::Exception& e) {
+        std::wcout << L"CFE caught Error " << e.what() <<std::endl;
+        status = false;
+    }
+    return status;
+}
+
+bool testFederate::destroyFederationExecution() {
+    try {
+        rtiAmb->destroyFederationExecution(federationName);
+    }
+    catch (rti1516e::Exception& e) {
+        std::wcout << L"DFE caught Error " << e.what() <<std::endl;
+        status = false;
+    }
+    return status;
+}
+
+bool testFederate::joinFederationExecution() {
+    try {
+        rtiAmb->joinFederationExecution(name,federationName);
+    }
+    catch (rti1516e::Exception& e) {
+        std::wcout << L"JFE caught Error " << e.what() <<std::endl;
+    }
+
+    return status;
+}
+
+bool testFederate::resignFederationExecution() {
+    try {
+           
rtiAmb->resignFederationExecution(rti1516e::CANCEL_THEN_DELETE_THEN_DIVEST);
+       }
+       catch (rti1516e::Exception& e) {
+           std::wcout << L"RFE caught Error " << e.what() <<std::endl;
+       }
+    return status;
+}
+
+bool testFederate::specificInitialize() {
+    try {
+        std::vector< std::wstring > constructorArgs;
+
+        std::auto_ptr <rti1516e::RTIambassadorFactory> rtiAmbFactory(new 
rti1516e::RTIambassadorFactory());
+        std::auto_ptr <rti1516e::RTIambassador > rtiAmbAP = 
rtiAmbFactory->createRTIambassador();
+        rtiAmb = rtiAmbAP.release();
+    } catch (rti1516e::Exception& e) {
+        std::wcout << L"RTIambassador creation caught Error " << e.what() 
<<std::endl;
+        status = false;
+    }
+    return status;
+}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]