certi-cvs
[Top][All Lists]
Advanced

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

[certi-cvs] certi test/utility/CMakeLists.txt libHLA/CMakeL...


From: certi-cvs
Subject: [certi-cvs] certi test/utility/CMakeLists.txt libHLA/CMakeL...
Date: Sat, 16 Jan 2010 20:17:14 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Eric NOULARD <erk>      10/01/16 20:17:14

Modified files:
        test/utility   : CMakeLists.txt 
        libHLA         : CMakeLists.txt 
        libCERTI       : Exception.hh Exception.cc CMakeLists.txt 
Added files:
        test/utility   : SharedStruct.hh Main_SocketSHM.cc 
        libHLA         : sha1.c sha1.h 
        libCERTI       : SocketSHMSysV.cc RingBuffer.hh SocketSHM.cc 
                         SemaphorePosix.hh Semaphore.hh 
                         SemaphorePosix.cc SemaphoreWin32.hh SHMSysV.hh 
                         SocketSHMPosix.cc SHMPosix.hh SemaphoreSysV.hh 
                         SocketSHM.hh SocketSHMPosix.hh SHMPosix.cc 
                         SemaphoreSysV.cc SocketSHMSysV.hh SHMSysV.cc 
                         RingBuffer.cc SemaphoreWin32.cc SHM.hh 

Log message:
        Merge-in the br_CERTI_SHM_NEWGEN_dev branch
        The merged code is not ready nor finalized but since
        it is NOT used by default I'd rather merge in now
        before discrepancy between the branch and HEAD is too big.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/test/utility/CMakeLists.txt?cvsroot=certi&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/certi/test/utility/SharedStruct.hh?cvsroot=certi&rev=1.2
http://cvs.savannah.gnu.org/viewcvs/certi/test/utility/Main_SocketSHM.cc?cvsroot=certi&rev=1.2
http://cvs.savannah.gnu.org/viewcvs/certi/libHLA/CMakeLists.txt?cvsroot=certi&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/certi/libHLA/sha1.c?cvsroot=certi&rev=1.2
http://cvs.savannah.gnu.org/viewcvs/certi/libHLA/sha1.h?cvsroot=certi&rev=1.2
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Exception.hh?cvsroot=certi&r1=3.8&r2=3.9
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Exception.cc?cvsroot=certi&r1=3.18&r2=3.19
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/CMakeLists.txt?cvsroot=certi&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketSHMSysV.cc?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/RingBuffer.hh?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketSHM.cc?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SemaphorePosix.hh?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Semaphore.hh?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SemaphorePosix.cc?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SemaphoreWin32.hh?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SHMSysV.hh?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketSHMPosix.cc?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SHMPosix.hh?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SemaphoreSysV.hh?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketSHM.hh?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketSHMPosix.hh?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SHMPosix.cc?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SemaphoreSysV.cc?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketSHMSysV.hh?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SHMSysV.cc?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/RingBuffer.cc?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SemaphoreWin32.cc?cvsroot=certi&rev=3.1
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SHM.hh?cvsroot=certi&rev=3.1

Patches:
Index: test/utility/CMakeLists.txt
===================================================================
RCS file: /sources/certi/certi/test/utility/CMakeLists.txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- test/utility/CMakeLists.txt 7 Dec 2008 20:16:17 -0000       1.4
+++ test/utility/CMakeLists.txt 16 Jan 2010 20:17:14 -0000      1.5
@@ -16,3 +16,27 @@
     ARCHIVE DESTINATION lib)
 
 ADD_TEST(CertiUtilTests CertiUtilTests)
+
+ADD_EXECUTABLE(CertiProcessus_A Main_SocketSHM.cc SharedStruct.hh)
+IF(WIN32)
+    TARGET_LINK_LIBRARIES(CertiProcessus_A CERTI)
+ELSE(WIN32)
+    TARGET_LINK_LIBRARIES(CertiProcessus_A CERTI rt)
+ENDIF(WIN32)
+
+SET_TARGET_PROPERTIES(CertiProcessus_A PROPERTIES COMPILE_FLAGS -DSIDE_SC)
+
+ADD_EXECUTABLE(CertiProcessus_B Main_SocketSHM.cc SharedStruct.hh)
+
+IF(WIN32)
+    TARGET_LINK_LIBRARIES(CertiProcessus_B CERTI)
+ELSE(WIN32)
+    TARGET_LINK_LIBRARIES(CertiProcessus_B CERTI rt)
+ENDIF(WIN32)
+
+SET_TARGET_PROPERTIES(CertiProcessus_B PROPERTIES COMPILE_FLAGS -DSIDE_CS)
+
+INSTALL(TARGETS CertiProcessus_A CertiProcessus_B
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib)

Index: libHLA/CMakeLists.txt
===================================================================
RCS file: /sources/certi/certi/libHLA/CMakeLists.txt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- libHLA/CMakeLists.txt       6 Nov 2008 16:18:38 -0000       1.4
+++ libHLA/CMakeLists.txt       16 Jan 2010 20:17:14 -0000      1.5
@@ -3,6 +3,11 @@
     HLAbuffer.hh HLAbuffer.cc
 )
  
+enable_language(C)
+SET(CERTI_UTILITY_SRCS sha1.c sha1.h)
+set_source_files_properties(sha1.c sha1.h PROPERTIES LANGUAGE "C")
+        
+ 
 SOURCE_GROUP("Source Files\\Types1516" FILES ${CERTI_TYPES1516_SRCS})
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
@@ -17,6 +22,7 @@
 
 ADD_LIBRARY(HLA
     ${CERTI_TYPES1516_SRCS}
+    ${CERTI_UTILITY_SRCS}
 )
 
 SET_TARGET_PROPERTIES(HLA PROPERTIES PROJECT_LABEL LibHLA)
@@ -42,6 +48,7 @@
     HLAvariableArray.hh
     HLAfixedRecord.hh
     HLAvariantRecord.hh
+    sha1.h
     DESTINATION include)
 
 INSTALL(PROGRAMS

Index: libCERTI/Exception.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Exception.hh,v
retrieving revision 3.8
retrieving revision 3.9
diff -u -b -r3.8 -r3.9
--- libCERTI/Exception.hh       7 Dec 2008 20:16:13 -0000       3.8
+++ libCERTI/Exception.hh       16 Jan 2010 20:17:14 -0000      3.9
@@ -20,7 +20,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Exception.hh,v 3.8 2008/12/07 20:16:13 gotthardp Exp $
+// $Id: Exception.hh,v 3.9 2010/01/16 20:17:14 erk Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef _CERTI_EXCEPTION_HH
@@ -105,6 +105,27 @@
     e_SaveInProgress,
     e_SaveNotInitiated,
     e_SecurityError,
+    e_SharedMemoryNotOpen,
+    e_SharedMemoryNotAttached,
+    e_SharedMemoryNotClosed,
+    e_SemaphoreNotCreated,
+    e_SemaphoreNotOpen,
+    e_SemaphoreHandlingError,
+    e_HandleNotClosed,
+    e_SocketNotConnected,
+    e_MessageNotSent,
+    e_MessageNotReceived,
+    e_SocketNotClosed,
+    e_RingBufferNotCreated,
+    e_RingBufferNotClosed,
+    e_RingBufferNotDeleted,
+    e_RingBufferNotAttached,
+    e_MessageTooLong,
+    e_BufferFull,
+    e_BufferEmpty,
+    e_SocketSHMNotCreated,
+    e_SocketSHMNotOpen,
+    e_SocketSHMNotDeleted,
     e_SpecifiedSaveLabelDoesNotExist,
     e_TimeAdvanceAlreadyInProgress,
     e_TimeAdvanceWasNotInProgress,
@@ -266,9 +287,30 @@
 CERTI_EXCEPTION(UnknownLabel)
 CERTI_EXCEPTION(NetworkSignal)
 CERTI_EXCEPTION(NetworkError)
+CERTI_EXCEPTION(SharedMemoryNotOpen)
+CERTI_EXCEPTION(SharedMemoryNotAttached)
+CERTI_EXCEPTION(SharedMemoryNotClosed)
+CERTI_EXCEPTION(SemaphoreNotOpen)
+CERTI_EXCEPTION(SemaphoreHandlingError)
+CERTI_EXCEPTION(SemaphoreNotCreated)
+CERTI_EXCEPTION(SocketNotConnected)
+CERTI_EXCEPTION(MessageNotSent)
+CERTI_EXCEPTION(MessageNotReceived)
+CERTI_EXCEPTION(SocketNotClosed)
+CERTI_EXCEPTION(HandleNotClosed)
+CERTI_EXCEPTION(RingBufferNotCreated)
+CERTI_EXCEPTION(RingBufferNotClosed)
+CERTI_EXCEPTION(RingBufferNotDeleted)
+CERTI_EXCEPTION(RingBufferNotAttached)
+CERTI_EXCEPTION(MessageTooLong)
+CERTI_EXCEPTION(BufferEmpty)
+CERTI_EXCEPTION(BufferFull)
+CERTI_EXCEPTION(SocketSHMNotCreated)
+CERTI_EXCEPTION(SocketSHMNotOpen)
+CERTI_EXCEPTION(SocketSHMNotDeleted)
 
 } // namespace certi
 
 #endif // _CERTI_EXCEPTION_HH
 
-// $Id: Exception.hh,v 3.8 2008/12/07 20:16:13 gotthardp Exp $
+// $Id: Exception.hh,v 3.9 2010/01/16 20:17:14 erk Exp $

Index: libCERTI/Exception.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Exception.cc,v
retrieving revision 3.18
retrieving revision 3.19
diff -u -b -r3.18 -r3.19
--- libCERTI/Exception.cc       21 Oct 2009 20:04:46 -0000      3.18
+++ libCERTI/Exception.cc       16 Jan 2010 20:17:14 -0000      3.19
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Exception.cc,v 3.18 2009/10/21 20:04:46 erk Exp $
+// $Id: Exception.cc,v 3.19 2010/01/16 20:17:14 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include "Exception.hh"
@@ -133,6 +133,27 @@
 long certi::UnknownLabel::_type = certi::e_UnknownLabel ;
 long certi::NetworkError::_type = certi::e_NetworkError ;
 long certi::NetworkSignal::_type = certi::e_NetworkSignal ;
+long certi::SharedMemoryNotOpen::_type = certi::e_SharedMemoryNotOpen ;
+long certi::SharedMemoryNotAttached::_type = certi::e_SharedMemoryNotAttached ;
+long certi::SharedMemoryNotClosed::_type = certi::e_SharedMemoryNotClosed ;
+long certi::HandleNotClosed::_type = certi::e_HandleNotClosed ;
+long certi::SemaphoreNotCreated::_type = certi::e_SemaphoreNotCreated ;
+long certi::SemaphoreNotOpen::_type = certi::e_SemaphoreNotOpen ;
+long certi::SemaphoreHandlingError::_type = certi::e_SemaphoreHandlingError ;
+long certi::SocketNotConnected::_type = certi::e_SocketNotConnected ;
+long certi::MessageNotSent::_type = certi::e_MessageNotSent ;
+long certi::MessageNotReceived::_type = certi::e_MessageNotReceived ;
+long certi::SocketNotClosed::_type = certi::e_SocketNotClosed ;
+long certi::RingBufferNotCreated::_type = certi::e_RingBufferNotCreated ;
+long certi::RingBufferNotClosed::_type = certi::e_RingBufferNotClosed ;
+long certi::RingBufferNotDeleted::_type = certi::e_RingBufferNotDeleted ;
+long certi::RingBufferNotAttached::_type = certi::e_RingBufferNotAttached ;
+long certi::MessageTooLong::_type = certi::e_MessageTooLong ;
+long certi::BufferFull::_type = certi::e_BufferFull ;
+long certi::BufferEmpty::_type = certi::e_BufferEmpty ;
+long certi::SocketSHMNotCreated::_type = certi::e_SocketSHMNotCreated ;
+long certi::SocketSHMNotOpen::_type = certi::e_SocketSHMNotOpen ;
+long certi::SocketSHMNotDeleted::_type = certi::e_SocketSHMNotDeleted ;
 
 static PrettyDebug PD_Exception("CERTI_EXCEPTION",__FILE__);
 
@@ -158,4 +179,4 @@
     Debug(PD_Exception, pdExcept) << msg.str();
     return msg.str();
 }
-// $Id: Exception.cc,v 3.18 2009/10/21 20:04:46 erk Exp $
+// $Id: Exception.cc,v 3.19 2010/01/16 20:17:14 erk Exp $

Index: libCERTI/CMakeLists.txt
===================================================================
RCS file: /sources/certi/certi/libCERTI/CMakeLists.txt,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- libCERTI/CMakeLists.txt     16 Oct 2009 21:34:24 -0000      1.27
+++ libCERTI/CMakeLists.txt     16 Jan 2010 20:17:14 -0000      1.28
@@ -125,6 +125,46 @@
 Socket.hh
 )
 
+if (WIN32)
+    include_directories(${CERTI_SOURCE_DIR}/libHLA)
+    ADD_DEFINITIONS(-DDEBUG)
+    SET(CERTI_SHM_SRCS
+        SHM.hh SHMWin32.hh SHMWin32.cc)
+
+    SET(CERTI_SEMAPHORE_SRCS
+        Semaphore.hh SemaphoreWin32.hh SemaphoreWin32.cc)
+
+    SET(CERTI_SOCKET_SHM_SRC
+        SocketSHM.cc SocketSHM.hh
+        SocketSHMWin32.cc SocketSHMWin32.hh
+       RingBuffer.cc RingBuffer.hh)
+
+    LIST(APPEND CERTI_SOCKET_SRCS ${CERTI_SHM_SRCS} ${CERTI_SEMAPHORE_SRCS} 
${CERTI_SOCKET_SHM_SRC})
+else(WIN32)
+    include_directories(${CERTI_SOURCE_DIR}/libHLA)
+    ADD_DEFINITIONS(-DDEBUG)
+
+    SET(CERTI_SHM_SRCS
+        SHM.hh
+        SHMPosix.cc SHMPosix.hh
+        SHMSysV.cc SHMSysV.hh)
+
+    SET(CERTI_SEMAPHORE_SRCS
+        Semaphore.hh
+        SemaphorePosix.cc SemaphorePosix.hh
+        SemaphoreSysV.cc SemaphoreSysV.hh
+        )
+
+    SET(CERTI_SOCKET_SHM_SRC
+        SocketSHM.cc SocketSHM.hh
+        SocketSHMPosix.cc SocketSHMPosix.hh
+        SocketSHMSysV.cc SocketSHMSysV.hh
+       RingBuffer.cc RingBuffer.hh
+        )
+
+    LIST(APPEND CERTI_SOCKET_SRCS ${CERTI_SHM_SRCS} ${CERTI_SEMAPHORE_SRCS} 
${CERTI_SOCKET_SHM_SRC})
+endif(WIN32)
+
 SET(CERTI_SOCKET_SRCS ${CERTI_SOCKET_SRCS} SocketUDP.cc SocketMC.cc 
SocketUN.cc SocketUDP.hh SocketMC.hh SocketUN.hh)
 IF (WIN32)
     SET(CERTI_SOCKET_SRCS ${CERTI_SOCKET_SRCS} socketpair_win32.c)
@@ -206,7 +246,7 @@
 TARGET_LINK_LIBRARIES(CERTI
     ${LIBXML2_LIBRARIES}
     ${GEN_LIBRARY}
-    ${SOCKET_LIBRARY})
+    ${SOCKET_LIBRARY} HLA)
 IF (MINGW)
     SET_TARGET_PROPERTIES(CERTI PROPERTIES LINK_FLAGS 
"-Wl,--output-def,${LIBRARY_OUTPUT_PATH}/libCERTI.def")
     INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/libCERTI.def

Index: test/utility/SharedStruct.hh
===================================================================
RCS file: test/utility/SharedStruct.hh
diff -N test/utility/SharedStruct.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test/utility/SharedStruct.hh        16 Jan 2010 20:17:14 -0000      1.2
@@ -0,0 +1,14 @@
+#ifndef SHARED_STRUCT_H
+#define SHARED_STRUCT_H
+
+/* For FILE */
+#include <stdio.h>
+
+typedef struct {
+    int Header;
+    double Body;
+} shared_struct ;
+
+#endif
+
+

Index: test/utility/Main_SocketSHM.cc
===================================================================
RCS file: test/utility/Main_SocketSHM.cc
diff -N test/utility/Main_SocketSHM.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test/utility/Main_SocketSHM.cc      16 Jan 2010 20:17:14 -0000      1.2
@@ -0,0 +1,376 @@
+// ----------------------------------------------------------------------------
+// CERTI - HLA RunTime Infrastructure
+// Copyright (C) 2002-2005  ONERA
+//
+// This program is free software ; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation ; either version 2 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY ; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program ; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA
+// ----------------------------------------------------------------------------
+
+// WARNING For SysV use :
+// Before Use : --> #ipcs
+// You can see all the semaphore and the shared memory in use
+//  --> #ipcrm -m id_memory to erase a memory segment
+//  --> #ipcrm -s id_semaphore to erase a semaphore
+
+// Systems includes
+#include <limits>
+
+// Specifics includes
+#ifdef _WIN32
+  #include <windows.h>
+  #include <process.h>
+  #include "SocketSHMWin32.hh"
+#else
+  #include "SocketSHMPosix.hh"
+  #include "SocketSHMSysV.hh"
+#endif
+
+#include "RingBuffer.hh"
+#include "SharedStruct.hh"
+
+
+#define NAME_AB "SocketAB"  // Socket Name
+#define MAX_SIZE 50
+
+
+/****************************************/
+/*********** MAIN PROGRAM ***************/
+/****************************************/
+
+int main(){
+
+// ************
+// DECLARATIONS
+// ************
+int i = 1 ; // Count for while
+shared_struct Data_Read ; // Data read in the Socket
+shared_struct Data_Write ; // Data write in the Socket
+std::string Shm_Sem_Type = "Win32" ;
+
+#ifdef SIDE_SC
+SocketSHM::SHM_SIDE_t Socket_Side = SocketSHM::SHM_SC ; // which side am I?
+RingBuffer::BUFFER_SIDE_t Buffer_Side = RingBuffer::BUFFER_SC ; // which 
Buffer side am I?
+#else
+SocketSHM::SHM_SIDE_t Socket_Side = SocketSHM::SHM_CS ; // which side am I?
+RingBuffer::BUFFER_SIDE_t Buffer_Side = RingBuffer::BUFFER_CS ; // which 
Buffer side am I?
+#endif
+
+std::string command;
+
+
+int Size ;
+Size = (int) sizeof(shared_struct) ;
+
+// Initialize Datas
+Data_Read.Header = 0 ; Data_Read.Body =0.0 ;
+Data_Write.Header = 0 ; Data_Write.Body =0.0 ;
+
+// ************
+//    CODE
+// ************
+#ifdef _WIN32
+SocketSHMWin32 Socket_Win32_AB(NAME_AB,Socket_Side,Size) ;
+#else
+// Posix Socket SHM
+SocketSHMPosix Socket_Posix_AB(NAME_AB,
+                               Socket_Side,
+                               Size) ;
+
+// SystemV Socket SHM
+SocketSHMSysV Socket_SysV_AB(NAME_AB,
+                             Socket_Side,
+                             Size) ;
+#endif
+// RingBuffer Socket SHM
+
+RingBuffer RingBuffer_AB(NAME_AB,
+                         Buffer_Side,
+                         MAX_SIZE,
+                         Shm_Sem_Type ) ;
+
+// ****************************
+// Wainting for User Command n1
+std::cout << "************************************************************" << 
std::endl ;
+std::cout << "******* END OF INITIALIZATION PHASE 1 : ********************" << 
std::endl ;
+#ifdef SIDE_SC
+std::cout << "*************** Wait for Processus B ***********************" << 
std::endl ;
+#else
+std::cout << "*************** Wait for Processus A ***********************" << 
std::endl ;
+#endif
+std::cout << "************************************************************" << 
std::endl ;
+std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
+
+#ifdef _WIN32
+try {
+   Socket_Win32_AB.Connect();
+}
+catch (certi::SocketNotConnected& e)
+{
+    std::cout << "Catch Exception SocketNotConnected" << std::endl ;
+    std::cout << "SocketSHM::Connect() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+}
+#else
+Socket_Posix_AB.Connect() ; // Connect to created Semaphores
+Socket_SysV_AB.Connect() ; // Connect to created Semaphores
+#endif
+
+try {
+    RingBuffer_AB.Attach() ;
+}
+catch (certi::RingBufferNotAttached& e)
+{
+    std::cout << "Catch Exception RingBufferNotAttached" << std::endl ;
+    std::cout << "RingBuffer::Attach() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+}
+
+// ****************************
+// Wainting for User Command n2
+std::cout << "*******************************************************" << 
std::endl ;
+std::cout << "*********** END OF INITIALIZATION PHASE 2 : ***********" << 
std::endl ;
+#ifdef _WIN32
+std::cout << "*** Click \"Win32\" to Open Win32 Socket SHM ************" << 
std::endl ;
+#else
+std::cout << "*** Click \"Posix\" to Open Posix Socket SHM ************" << 
std::endl ;
+std::cout << "*** Click \"SysV\" to Open Systeme V Socket SHM *********" << 
std::endl ;
+#endif
+std::cout << "*** Click \"RB\" to Open Ring Buffer SHM **************" << 
std::endl ;
+std::cout << "*******************************************************" << 
std::endl ;
+std::cin >> command;
+std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
+
+// Verify the command
+while (command !="Win32" && command != "Posix" && command != "SysV" && command 
!= "RB") {
+    std::cout << "Wrong Command : Command must be : Win32 , Posix , SysV or 
RB" << std ::endl ;
+    std::cin >> command;
+    std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' ); }
+
+// Open the Socket
+#ifdef _WIN32
+if (command=="Win32")
+{
+    try {
+       Socket_Win32_AB.Open() ;
+    }
+    catch (certi::SocketSHMNotOpen& e)
+    {
+        std::cout << "Catch Exception SocketSHMNotOpen" << std::endl ;
+        std::cout << "SocketSHMWin32::Open() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+    }
+}
+#else
+if (command=="Posix") Socket_Posix_AB.Open() ;
+if (command=="SysV") Socket_SysV_AB.Open() ;
+#endif
+
+// ****************************
+// Wainting for User Command n3
+std::cout << "************************************************************" << 
std::endl ;
+std::cout << "******* END OF INITIALIZATION PHASE 3 : ********************" << 
std::endl ;
+std::cout << "****** Click \"ENTER\" to RunInter Process Exchange... *******" 
<< std::endl ;
+std::cout << "************************************************************" << 
std::endl ;
+std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
+
+// If Ring Buffer USE
+if (command=="RB"){
+   shared_struct Data_Read_RB ; // Data read in the Socket
+   Data_Read_RB.Header = 0 ; Data_Read_RB.Body =0.0 ;
+   shared_struct Data_Write_RB ; // Data write in the Socket
+   Data_Write_RB.Header = 0 ; Data_Write_RB.Body =0.0 ;
+   std::string command_RB ;
+   // *********************************************
+   // Wainting for User Command n4 (For Ring Buffer)
+   std::cout << "********************************************************" << 
std::endl ;
+   std::cout << "*** Put \"S\" to Send Data on RingBuffer ***************" << 
std::endl ;
+   std::cout << "*** Put \"R\" to Receive Data on RingBuffer ************" << 
std::endl ;
+   std::cout << "*** Put \"END\" to Close RingBuffer Exchange ***********" << 
std::endl ;
+   std::cout << "********************************************************" << 
std::endl ;
+
+    // *************************
+    // Computing RingBuffer SHM
+    // *************************
+   while(i<1000) {
+     // Initialize Datas
+     Data_Write_RB.Header = i ; Data_Write_RB.Body = i * 0.1 ;
+     std::cin >> command_RB ;
+     std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
+     if (command_RB=="S"){
+         try {
+            RingBuffer_AB.Send(&Data_Write_RB,Size) ;
+            std::cout << " ******** SEND ********" << std ::endl ;
+            #ifdef SIDE_SC
+            std::cout << "Processus A :: DataWrite_RB.Header = " << 
Data_Write_RB.Header << std ::endl ;
+            std::cout << "Processus A :: DataWrite_RB.Body = " << 
Data_Write_RB.Body << std ::endl ;
+            #else
+            std::cout << "Processus B :: DataWrite_RB.Header = " << 
Data_Write_RB.Header << std ::endl ;
+            std::cout << "Processus B :: DataWrite_RB.Body = " << 
Data_Write_RB.Body << std ::endl ;
+            #endif
+            std::cout << " ************************ " <<  std ::endl ;
+         }
+         catch (certi::BufferFull& e)
+         {
+            std::cout << "Catch Exception BufferFull" << std::endl ;
+            std::cout << "RingBuffer::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+         }
+         i++ ;
+         }
+     else if (command_RB=="R"){
+         try {
+            RingBuffer_AB.Receive(&Data_Read_RB,Size) ;
+         }
+         catch(certi::BufferEmpty& e)
+         {
+             std::cout << "Catch Exception BufferEmpty" << std::endl ;
+             std::cout << "RingBuffer::Receive() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+         }
+
+         std::cout << " ****** RECEIVE ******" << std ::endl ;
+         #ifdef SIDE_SC
+         std::cout << "Processus A :: DataRead_RB.Header = " << 
Data_Read_RB.Header << std ::endl ;
+         std::cout << "Processus A :: DataRead_RB.Body = " << 
Data_Read_RB.Body << std ::endl ;
+         #else
+         std::cout << "Processus B :: DataRead_RB.Header = " << 
Data_Read_RB.Header << std ::endl ;
+         std::cout << "Processus B :: DataRead_RB.Body = " << 
Data_Read_RB.Body << std ::endl ;
+         #endif
+         std::cout << " ************************** " <<  std::endl ;
+         }
+      else if (command_RB=="END"){ i=1000; }
+      else{std::cout << "Wrong Command : Command must be : S , R or END" << 
std ::endl ;}
+      } // End of while
+    }
+else{ // else SocketSHM (SysV and Posix) Use
+    #ifdef SIDE_SC
+    // Send to B For the First Time (INITIALIZE)
+    // Send to B
+        #ifdef _WIN32
+        if (command=="Win32")
+        {
+            try {
+                Socket_Win32_AB.Send(&Data_Write) ;
+            }
+            catch (certi::MessageNotSent& e)
+            {
+               std::cout << "Catch Exception MessageNotSent" << std::endl ;
+               std::cout << "SocketSHM::Send() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+            }
+        }
+        #else
+        if (command=="Posix") Socket_Posix_AB.Send(&Data_Write) ;
+        if (command=="SysV") Socket_SysV_AB.Send(&Data_Write) ;
+        #endif
+    #endif
+    // *********************
+    // Computing Socket SHM
+    // *********************
+    while(i<1000) {
+       std::cout << " ***********  COMPUTING PHASE n°= " << i << 
"*************" << std ::endl ;
+
+       /**************************************/
+       /************* RECEIVING **************/
+       /**************************************/
+       // Read from B
+       #ifdef _WIN32
+       if (command=="Win32")
+       {
+           try {
+              Socket_Win32_AB.Receive(&Data_Read) ;
+           }
+           catch (certi::MessageNotReceived& e)
+           {
+               std::cout << "Catch Exception MessageNotReceived" << std::endl ;
+               std::cout << "SocketSHM::Receive() Exception. " <<  "Name is : 
" << e._name << " Reason is : " << e._reason << std::endl ;
+           }
+       }
+       #else
+       if (command=="Posix") Socket_Posix_AB.Receive(&Data_Read) ;
+       if (command=="SysV") Socket_SysV_AB.Receive(&Data_Read) ;
+       #endif
+
+       /**************************************/
+       /************* COMPUTE ****************/
+       /**************************************/
+      // Print Receiving Data
+       std::cout << " ****** RECEIVE ******" << std ::endl ;
+       #ifdef SIDE_SC
+       std::cout << "Processus A :: DataRead.Header = " << Data_Read.Header 
<< std ::endl ;
+       std::cout << "Processus A :: DataRead.Body = " << Data_Read.Body << std 
::endl ;
+       #else
+       std::cout << "Processus B :: DataRead.Header = " << Data_Read.Header 
<< std ::endl ;
+       std::cout << "Processus B :: DataRead.Body = " << Data_Read.Body << std 
::endl ;
+       #endif
+       std::cout << " ************************** " <<  std::endl ;
+
+       // Product a new Data
+       Data_Write.Header = Data_Read.Header + 1 ;
+       Data_Write.Body = Data_Read.Body + 0.1 ;
+
+       // Print Sending Data
+       std::cout << " ******** SEND ********" << std ::endl ;
+       #ifdef SIDE_SC
+       std::cout << "Processus A :: DataWrite.Header = " << Data_Write.Header 
<< std ::endl ;
+       std::cout << "Processus A :: DataWrite.Body = " << Data_Write.Body << 
std ::endl ;
+       #else
+       std::cout << "Processus B :: DataWrite.Header = " << Data_Write.Header 
<< std ::endl ;
+       std::cout << "Processus B :: DataWrite.Body = " << Data_Write.Body << 
std ::endl ;
+       #endif
+       std::cout << " ************************ " <<  std ::endl ;
+
+       /**************************************/
+       /************* SENDING ****************/
+       /**************************************/
+       // Send to B
+       #ifdef _WIN32
+       if (command=="Win32")
+       {
+           try {
+               Socket_Win32_AB.Send(&Data_Write) ;
+           }
+           catch (certi::MessageNotSent& e)
+           {
+               std::cout << "Catch Exception MessageNotSent" << std::endl ;
+               std::cout << "SocketSHM::Send() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+           }
+       }
+       #else
+       if (command=="Posix") Socket_Posix_AB.Send(&Data_Write) ;
+       if (command=="SysV") Socket_SysV_AB.Send(&Data_Write) ;
+       #endif
+
+       // On incremente le compteur
+       i++ ;
+
+       } // End of while (i<1000)
+
+   } // end of else for if (commande=="RB")
+
+   // Waiting the two process are out of while boucle
+   #ifdef _WIN32
+     Sleep(1000) ;
+   #else
+     sleep(1) ;
+   #endif
+
+   // Close the Ring Buffer
+   RingBuffer_AB.Close() ;
+   // Close the socket
+   #ifdef _WIN32
+      if (command=="Win32") Socket_Win32_AB.Close() ;
+    #else
+       if (command=="Posix") Socket_Posix_AB.Close() ;;
+       if (command=="SysV") Socket_SysV_AB.Close() ;
+    #endif
+      std::cout << "END OF THE PROGRAM : SEE YOU SOON :) !!!!!!!!!!!"  << std 
::endl ;
+return 0 ;
+
+} // End of Main Program

Index: libHLA/sha1.c
===================================================================
RCS file: libHLA/sha1.c
diff -N libHLA/sha1.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libHLA/sha1.c       16 Jan 2010 20:17:14 -0000      1.2
@@ -0,0 +1,387 @@
+/*
+ * This code has been taken from RFC 3174 on 
+ * http://ww.rfc-editors.org/
+ * File has been renamed to bb_sha1.[hc] to avoid name clash.
+ * 
+ *  sha1.c
+ *
+ *  Description:
+ *      This file implements the Secure Hashing Algorithm 1 as
+ *      defined in FIPS PUB 180-1 published April 17, 1995.
+ *
+ *      The SHA-1, produces a 160-bit message digest for a given
+ *      data stream.  It should take about 2**n steps to find a
+ *      message with the same digest as a given message and
+ *      2**(n/2) to find any two messages with the same digest,
+ *      when n is the digest size in bits.  Therefore, this
+ *      algorithm can serve as a means of providing a
+ *      "fingerprint" for a message.
+ *
+ *  Portability Issues:
+ *      SHA-1 is defined in terms of 32-bit "words".  This code
+ *      uses <stdint.h> (included via "sha1.h" to define 32 and 8
+ *      bit unsigned integer types.  If your C compiler does not
+ *      support 32 bit unsigned integers, this code is not
+ *      appropriate.
+ *
+ *  Caveats:
+ *      SHA-1 is designed to work with messages less than 2^64 bits
+ *      long.  Although SHA-1 allows a message digest to be generated
+ *      for messages of any number of bits less than 2^64, this
+ *      implementation only works with messages with a length that is
+ *      a multiple of the size of an 8-bit character.
+ *
+ */
+#include "sha1.h"
+
+/*
+ *  Define the SHA1 circular left shift macro
+ */
+#define SHA1CircularShift(bits,word) \
+                (((word) << (bits)) | ((word) >> (32-(bits))))
+
+/* Local Function Prototyptes */
+void SHA1PadMessage(SHA1Context *);
+void SHA1ProcessMessageBlock(SHA1Context *);
+
+/*
+ *  SHA1Reset
+ *
+ *  Description:
+ *      This function will initialize the SHA1Context in preparation
+ *      for computing a new SHA1 message digest.
+ *
+ *  Parameters:
+ *      context: [in/out]
+ *          The context to reset.
+ *
+ *  Returns:
+ *      sha Error Code.
+ *
+ */
+int SHA1Reset(SHA1Context *context)
+{
+    if (!context)
+    {
+        return shaNull;
+    }
+
+    context->Length_Low             = 0;
+    context->Length_High            = 0;
+    context->Message_Block_Index    = 0;
+
+    context->Intermediate_Hash[0]   = 0x67452301;
+    context->Intermediate_Hash[1]   = 0xEFCDAB89;
+    context->Intermediate_Hash[2]   = 0x98BADCFE;
+    context->Intermediate_Hash[3]   = 0x10325476;
+    context->Intermediate_Hash[4]   = 0xC3D2E1F0;
+
+    context->Computed   = 0;
+    context->Corrupted  = 0;
+
+    return shaSuccess;
+}
+
+/*
+ *  SHA1Result
+ *
+ *  Description:
+ *      This function will return the 160-bit message digest into the
+ *      Message_Digest array  provided by the caller.
+ *      NOTE: The first octet of hash is stored in the 0th element,
+ *            the last octet of hash in the 19th element.
+ *
+ *  Parameters:
+ *      context: [in/out]
+ *          The context to use to calculate the SHA-1 hash.
+ *      Message_Digest: [out]
+ *          Where the digest is returned.
+ *
+ *  Returns:
+ *      sha Error Code.
+ *
+ */
+int SHA1Result( SHA1Context *context,
+                uint8_t Message_Digest[SHA1HashSize])
+{
+    int i;
+
+    if (!context || !Message_Digest)
+    {
+        return shaNull;
+    }
+
+    if (context->Corrupted)
+    {
+        return context->Corrupted;
+    }
+
+    if (!context->Computed)
+    {
+        SHA1PadMessage(context);
+        for(i=0; i<64; ++i)
+        {
+            /* message may be sensitive, clear it out */
+            context->Message_Block[i] = 0;
+        }
+        context->Length_Low = 0;    /* and clear length */
+        context->Length_High = 0;
+        context->Computed = 1;
+    }
+
+    for(i = 0; i < SHA1HashSize; ++i)
+    {
+        Message_Digest[i] = context->Intermediate_Hash[i>>2]
+                            >> 8 * ( 3 - ( i & 0x03 ) );
+    }
+
+    return shaSuccess;
+}
+
+/*
+ *  SHA1Input
+ *
+ *  Description:
+ *      This function accepts an array of octets as the next portion
+ *      of the message.
+ *
+ *  Parameters:
+ *      context: [in/out]
+ *          The SHA context to update
+ *      message_array: [in]
+ *          An array of characters representing the next portion of
+ *          the message.
+ *      length: [in]
+ *          The length of the message in message_array
+ *
+ *  Returns:
+ *      sha Error Code.
+ *
+ */
+int SHA1Input(    SHA1Context    *context,
+                  const uint8_t  *message_array,
+                  unsigned       length)
+{
+    if (!length)
+    {
+        return shaSuccess;
+    }
+
+    if (!context || !message_array)
+    {
+        return shaNull;
+    }
+
+    if (context->Computed)
+    {
+        context->Corrupted = shaStateError;
+        return shaStateError;
+    }
+
+    if (context->Corrupted)
+    {
+         return context->Corrupted;
+    }
+    while(length-- && !context->Corrupted)
+    {
+    context->Message_Block[context->Message_Block_Index++] =
+                    (*message_array & 0xFF);
+
+    context->Length_Low += 8;
+    if (context->Length_Low == 0)
+    {
+        context->Length_High++;
+        if (context->Length_High == 0)
+        {
+            /* Message is too long */
+            context->Corrupted = 1;
+        }
+    }
+
+    if (context->Message_Block_Index == 64)
+    {
+        SHA1ProcessMessageBlock(context);
+    }
+
+    message_array++;
+    }
+
+    return shaSuccess;
+}
+
+/*
+ *  SHA1ProcessMessageBlock
+ *
+ *  Description:
+ *      This function will process the next 512 bits of the message
+ *      stored in the Message_Block array.
+ *
+ *  Parameters:
+ *      None.
+ *
+ *  Returns:
+ *      Nothing.
+ *
+ *  Comments:
+ *      Many of the variable names in this code, especially the
+ *      single character names, were used because those were the
+ *      names used in the publication.
+ *
+ *
+ */
+void SHA1ProcessMessageBlock(SHA1Context *context)
+{
+    const uint32_t K[] =    {       /* Constants defined in SHA-1   */
+                            0x5A827999,
+                            0x6ED9EBA1,
+                            0x8F1BBCDC,
+                            0xCA62C1D6
+                            };
+    int           t;                 /* Loop counter                */
+    uint32_t      temp;              /* Temporary word value        */
+    uint32_t      W[80];             /* Word sequence               */
+    uint32_t      A, B, C, D, E;     /* Word buffers                */
+
+    /*
+     *  Initialize the first 16 words in the array W
+     */
+    for(t = 0; t < 16; t++)
+    {
+        W[t] = context->Message_Block[t * 4] << 24;
+        W[t] |= context->Message_Block[t * 4 + 1] << 16;
+        W[t] |= context->Message_Block[t * 4 + 2] << 8;
+        W[t] |= context->Message_Block[t * 4 + 3];
+    }
+
+    for(t = 16; t < 80; t++)
+    {
+       W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);
+    }
+
+    A = context->Intermediate_Hash[0];
+    B = context->Intermediate_Hash[1];
+    C = context->Intermediate_Hash[2];
+    D = context->Intermediate_Hash[3];
+    E = context->Intermediate_Hash[4];
+
+    for(t = 0; t < 20; t++)
+    {
+        temp =  SHA1CircularShift(5,A) +
+                ((B & C) | ((~B) & D)) + E + W[t] + K[0];
+        E = D;
+        D = C;
+        C = SHA1CircularShift(30,B);
+        B = A;
+        A = temp;
+    }
+
+    for(t = 20; t < 40; t++)
+    {
+        temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1];
+        E = D;
+        D = C;
+        C = SHA1CircularShift(30,B);
+        B = A;
+        A = temp;
+    }
+
+    for(t = 40; t < 60; t++)
+    {
+        temp = SHA1CircularShift(5,A) +
+               ((B & C) | (B & D) | (C & D)) + E + W[t] + K[2];
+        E = D;
+        D = C;
+        C = SHA1CircularShift(30,B);
+        B = A;
+        A = temp;
+    }
+
+    for(t = 60; t < 80; t++)
+    {
+        temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3];
+        E = D;
+        D = C;
+        C = SHA1CircularShift(30,B);
+        B = A;
+        A = temp;
+    }
+
+    context->Intermediate_Hash[0] += A;
+    context->Intermediate_Hash[1] += B;
+    context->Intermediate_Hash[2] += C;
+    context->Intermediate_Hash[3] += D;
+    context->Intermediate_Hash[4] += E;
+
+    context->Message_Block_Index = 0;
+}
+
+
+/*
+ *  SHA1PadMessage
+ *
+ *  Description:
+ *      According to the standard, the message must be padded to an even
+ *      512 bits.  The first padding bit must be a '1'.  The last 64
+ *      bits represent the length of the original message.  All bits in
+ *      between should be 0.  This function will pad the message
+ *      according to those rules by filling the Message_Block array
+ *      accordingly.  It will also call the ProcessMessageBlock function
+ *      provided appropriately.  When it returns, it can be assumed that
+ *      the message digest has been computed.
+ *
+ *  Parameters:
+ *      context: [in/out]
+ *          The context to pad
+ *      ProcessMessageBlock: [in]
+ *          The appropriate SHA*ProcessMessageBlock function
+ *  Returns:
+ *      Nothing.
+ *
+ */
+
+void SHA1PadMessage(SHA1Context *context)
+{
+    /*
+     *  Check to see if the current message block is too small to hold
+     *  the initial padding bits and length.  If so, we will pad the
+     *  block, process it, and then continue padding into a second
+     *  block.
+     */
+    if (context->Message_Block_Index > 55)
+    {
+        context->Message_Block[context->Message_Block_Index++] = 0x80;
+        while(context->Message_Block_Index < 64)
+        {
+            context->Message_Block[context->Message_Block_Index++] = 0;
+        }
+
+        SHA1ProcessMessageBlock(context);
+
+        while(context->Message_Block_Index < 56)
+        {
+            context->Message_Block[context->Message_Block_Index++] = 0;
+        }
+    }
+    else
+    {
+        context->Message_Block[context->Message_Block_Index++] = 0x80;
+        while(context->Message_Block_Index < 56)
+        {
+            context->Message_Block[context->Message_Block_Index++] = 0;
+        }
+    }
+
+    /*
+     *  Store the message length as the last 8 octets
+     */
+    context->Message_Block[56] = context->Length_High >> 24;
+    context->Message_Block[57] = context->Length_High >> 16;
+    context->Message_Block[58] = context->Length_High >> 8;
+    context->Message_Block[59] = context->Length_High;
+    context->Message_Block[60] = context->Length_Low >> 24;
+    context->Message_Block[61] = context->Length_Low >> 16;
+    context->Message_Block[62] = context->Length_Low >> 8;
+    context->Message_Block[63] = context->Length_Low;
+
+    SHA1ProcessMessageBlock(context);
+}

Index: libHLA/sha1.h
===================================================================
RCS file: libHLA/sha1.h
diff -N libHLA/sha1.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libHLA/sha1.h       16 Jan 2010 20:17:14 -0000      1.2
@@ -0,0 +1,112 @@
+/*
+ * This code has been taken from RFC 3174 on 
+ * http://ww.rfc-editors.org/
+ * File has been renamed to sha1.[hc] to avoid name clash.
+ * 
+ *  sha1.h
+ *
+ *  Description:
+ *      This is the header file for code which implements the Secure
+ *      Hashing Algorithm 1 as defined in FIPS PUB 180-1 published
+ *      April 17, 1995.
+ *
+ *      Many of the variable names in this code, especially the
+ *      single character names, were used because those were the names
+ *      used in the publication.
+ *
+ *      Please read the file sha1.c for more information.
+ *
+ */
+#ifndef _SHA1_H_
+#define _SHA1_H_
+
+#ifdef _MSC_VER
+typedef unsigned __int64  uint64_t;
+typedef signed __int64    int64_t;
+typedef unsigned __int32  uint32_t;
+typedef signed __int32    int32_t;
+typedef unsigned __int16  uint16_t;
+typedef signed __int16    int16_t;
+typedef unsigned __int8   uint8_t;
+typedef signed __int8     int8_t;
+#else
+#include <inttypes.h>
+#endif
+
+#if defined(_WIN32)
+    #pragma warning(disable: 4251)
+    #if defined(HLA_EXPORTS)
+        #define HLA_EXPORT __declspec(dllexport)
+    #else
+        #define HLA_EXPORT __declspec(dllimport)
+    #endif
+#else
+    #define HLA_EXPORT
+#endif
+
+/* BEGIN_C_DECLS should be used at the beginning of your declarations,
+   so that C++ compilers don't mangle their names.  Use END_C_DECLS at
+   the end of C declarations. */
+#undef BEGIN_C_DECLS
+#undef END_C_DECLS
+#ifdef __cplusplus
+#  define BEGIN_C_DECLS extern "C" {
+#  define END_C_DECLS }
+#else
+# define BEGIN_C_DECLS /* empty */
+# define END_C_DECLS /* empty */
+#endif
+
+/*
+ * If you do not have the ISO standard stdint.h header file, then you
+ * must typdef the following:
+ *    name              meaning
+ *  uint32_t         unsigned 32 bit integer
+ *  uint8_t          unsigned 8 bit integer (i.e., unsigned char)
+ *  int_least16_t    integer of >= 16 bits
+ *
+ */
+
+#ifndef _SHA_enum_
+#define _SHA_enum_
+enum
+{
+    shaSuccess = 0,
+    shaNull,            /* Null pointer parameter */
+    shaInputTooLong,    /* input data too long */
+    shaStateError       /* called Input after Result */
+};
+#endif
+#define SHA1HashSize 20
+
+/*
+ *  This structure will hold context information for the SHA-1
+ *  hashing operation
+ */
+typedef struct HLA_EXPORT SHA1Context
+{
+    uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest  */
+
+    uint32_t Length_Low;            /* Message length in bits      */
+    uint32_t Length_High;           /* Message length in bits      */
+
+                               /* Index into message block array   */
+    int_least16_t Message_Block_Index;
+    uint8_t Message_Block[64];      /* 512-bit message blocks      */
+
+    int Computed;               /* Is the digest computed?         */
+    int Corrupted;             /* Is the message digest corrupted? */
+} SHA1Context;
+
+BEGIN_C_DECLS
+
+/*
+ *  Function Prototypes
+ */
+HLA_EXPORT int SHA1Reset(  SHA1Context *);
+HLA_EXPORT int SHA1Input(  SHA1Context *, const uint8_t *, unsigned int);
+HLA_EXPORT int SHA1Result( SHA1Context *, uint8_t 
Message_Digest[SHA1HashSize]);
+
+END_C_DECLS
+
+#endif

Index: libCERTI/SocketSHMSysV.cc
===================================================================
RCS file: libCERTI/SocketSHMSysV.cc
diff -N libCERTI/SocketSHMSysV.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SocketSHMSysV.cc   16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,99 @@
+#include "SocketSHMSysV.hh"
+
+// ************************************************
+// Constructor with args
+// ************************************************
+SocketSHMSysV::SocketSHMSysV(const std::string& Socket_Name, 
+                             const SHM_SIDE_t& Socket_Side,
+                             const int Socket_Size ) : 
SocketSHM(Socket_Name,Socket_Side,Socket_Size) {
+
+if(_Side == SHM_SC){
+_Shm_SC = new SHMSysV(SHM::buildShmName(Socket_Name+"_SC"), Socket_Size,true) ;
+_Shm_CS = new SHMSysV(SHM::buildShmName(Socket_Name+"_CS"), Socket_Size) ;
+  }
+else {
+_Shm_CS = new SHMSysV(SHM::buildShmName(Socket_Name+"_CS"), Socket_Size,true) ;
+_Shm_SC = new SHMSysV(SHM::buildShmName(Socket_Name+"_SC"), Socket_Size) ;
+}
+
+// Semaphores
+_Sem_full_SC = new SemaphoreSysV() ;
+_Sem_empty_SC = new SemaphoreSysV() ;
+_Sem_full_CS = new SemaphoreSysV() ;
+_Sem_empty_CS = new SemaphoreSysV() ;
+
+int init_full = 0, init_empty = 1 ; // Initialisation values
+
+if(_Side == SHM_SC){
+  _Sem_full_SC->Create_Init(init_full, 
Semaphore::buildSemName(Socket_Name+"_FULL_SC")) ;
+  _Sem_empty_SC->Create_Init(init_empty, 
Semaphore::buildSemName(Socket_Name+"_EMPTY_SC")) ;
+  }
+else{
+  _Sem_full_CS->Create_Init(init_full, 
Semaphore::buildSemName(Socket_Name+"_FULL_CS")) ;
+  _Sem_empty_CS->Create_Init(init_empty, 
Semaphore::buildSemName(Socket_Name+"_EMPTY_CS")) ;
+  }
+
+}
+
+// ************************************************
+// Destructor
+// ************************************************
+SocketSHMSysV::~SocketSHMSysV() {
+
+if(_Side == SHM_SC){
+   _Sem_full_SC->Delete() ;
+   _Sem_empty_SC->Delete() ;
+   }
+else{
+   _Sem_full_CS->Delete() ;
+   _Sem_empty_CS->Delete() ;
+   } 
+
+}
+
+// ************************************************
+// Method : SocketSHMSysV::Open()
+// ************************************************
+void SocketSHMSysV::Open() {
+
+if(_Side == SHM_SC){
+    _Sem_empty_SC->P() ; 
+     _Shm_SC->Open() ;
+     _Shm_SC->Attach() ;
+    _Sem_empty_SC->V() ;
+    #ifdef DEBUG
+    std::cout << " The SHM from Server to Customer is Create and attach " << 
std::endl ;
+    #endif
+     } 
+else{
+     _Sem_empty_CS->P() ;
+     _Shm_CS->Open() ;
+     _Shm_CS->Attach() ;
+     _Sem_empty_CS->V() ;
+     #ifdef DEBUG
+     std::cout << " The SHM from Customer to Server is Create and Attach" << 
std::endl ;
+     #endif
+     } 
+if(_Side == SHM_CS){
+     _Sem_empty_SC->P() ;  
+     _Shm_SC->Open() ;
+     _Shm_SC->Attach() ;
+     _Sem_empty_SC->V() ;
+     #ifdef DEBUG
+     std::cout << " The SHM from Server to Customer is identified and attached 
" << std::endl ;
+     #endif
+     } 
+else{
+     _Sem_empty_CS->P() ;  
+     _Shm_CS->Open() ;
+     _Shm_CS->Attach() ;
+     _Sem_empty_CS->V() ;
+     #ifdef DEBUG
+     std::cout << " The SHM from Customer to Server is identified and attached 
" << std::endl ;
+     #endif
+     } 
+
+} // End of Open()
+
+
+

Index: libCERTI/RingBuffer.hh
===================================================================
RCS file: libCERTI/RingBuffer.hh
diff -N libCERTI/RingBuffer.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/RingBuffer.hh      16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,80 @@
+// ----------------------------------------------------------------------------
+// CERTI - HLA RunTime Infrastructure
+// Copyright (C) 2002-2005  ONERA
+//
+// This program is free software ; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation ; either version 2 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY ; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program ; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// ----------------------------------------------------------------------------
+
+#ifndef RING_BUFFER_H
+#define RING_BUFFER_H
+
+#include <iostream>
+
+// Specifics includes
+#include "SHM.hh"
+#include "Semaphore.hh"
+
+class CERTI_EXPORT RingBuffer {
+public :
+    // Typedef Side
+    typedef enum{BUFFER_SC,BUFFER_CS} BUFFER_SIDE_t ;
+
+    // Constructor
+    RingBuffer(const std::string& RingBuffer_Name,
+               const BUFFER_SIDE_t& RingBuffer_Side,
+               const int RingBuffer_Size,
+               const std::string& SHM_Sem_Type ) // SHM_Sem_Type = Posix,SysV 
ou Win32
+               throw(certi::RingBufferNotCreated) ;
+    // Destructor
+    ~RingBuffer () throw(certi::RingBufferNotDeleted) ;
+
+    void Attach() throw(certi::RingBufferNotAttached) ;
+
+    void Send(void *Buffer, size_t Size)      // To send Data on a memory 
segment
+              throw (certi::MessageNotSent,
+                     certi::MessageTooLong,
+                     certi::BufferFull) ;
+
+    void Receive(void *Buffer, size_t Size)   // To receive Data on a memory 
segment
+              throw (certi::MessageNotReceived,
+                     certi::MessageTooLong,
+                     certi::BufferEmpty) ;
+
+    void Close() throw (certi::RingBufferNotClosed) ; // To Close the two SHMs
+
+protected :
+    std::string _Name ;
+    BUFFER_SIDE_t _Side ;
+    size_t _Size ;
+
+    /***** Server -->>> Customer ******/
+    SHM *_Shm_SC ;
+    SHM *_Pw_Pr_SC ;
+    // _Count_SC, _Write_SC, _Read_SC
+    // int _Tab_SC[3] ;
+    int* _Tab_SC ;
+    Semaphore *_Sem_SC ;
+
+    /***** Customer -->>> Server ******/
+    SHM *_Shm_CS ;
+    SHM *_Pw_Pr_CS ;
+    // _Count_CS, _Write_CS, _Read_CS
+    // int _Tab_CS[3] ;
+    int* _Tab_CS ;
+    Semaphore *_Sem_CS ;
+
+}; // End of --> class SocketSHM
+
+#endif

Index: libCERTI/SocketSHM.cc
===================================================================
RCS file: libCERTI/SocketSHM.cc
diff -N libCERTI/SocketSHM.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SocketSHM.cc       16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,210 @@
+#include "SocketSHM.hh"
+#include <cstring>
+
+// ************************************************
+// Destructor
+// ************************************************
+SocketSHM ::~SocketSHM (){}
+
+// ************************************************
+// Method : SocketSHM::Connect()
+// ************************************************
+void SocketSHM::Connect() throw (certi::SocketNotConnected) {
+
+#ifdef DEBUG
+std::cout << "Try to Connect..." << std::endl ;
+#endif
+
+if(_Side == SHM_CS){
+    try {
+       _Sem_full_SC->Attach(Semaphore::buildSemName(_Name+"_FULL_SC")) ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "SocketSHM::Connect() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::SocketNotConnected("Connect() failed."));
+    }
+    try {
+       _Sem_empty_SC->Attach(Semaphore::buildSemName(_Name+"_EMPTY_SC")) ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "SocketSHM::Connect() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::SocketNotConnected("Connect() failed."));
+    }
+  }
+else{
+    try {
+       _Sem_full_CS->Attach(Semaphore::buildSemName(_Name+"_FULL_CS")) ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "SocketSHM::Connect() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::SocketNotConnected("Connect() failed."));
+    }
+    try {
+       _Sem_empty_CS->Attach(Semaphore::buildSemName(_Name+"_EMPTY_CS")) ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "SocketSHM::Connect() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::SocketNotConnected("Connect() failed."));
+    }
+  }
+
+}
+
+// ************************************************
+// Method : SocketSHM::Send(...)
+// ************************************************
+void SocketSHM::Send(void *Buffer) throw (certi::MessageNotSent) {
+
+#ifdef DEBUG
+std::cout << "Try to Send..." << std::endl ;
+#endif
+
+if(_Side == SHM_SC){
+    try {
+       _Sem_empty_SC->P() ;
+    }
+    catch(certi::SemaphoreHandlingError& e)
+    {
+        std::cout << "SocketSHM::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::MessageNotSent("Send() failed.")) ;
+    }
+
+    memcpy(_Shm_SC->GetShm(), Buffer, _Shm_SC->GetSize());
+
+    try {
+       _Sem_full_SC->V() ;
+    }
+    catch(certi::SemaphoreHandlingError& e)
+    {
+        std::cout << "SocketSHM::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::MessageNotSent("Send() failed.")) ;
+    }
+    }
+else{
+    try {
+       _Sem_empty_CS->P() ;
+    }
+    catch(certi::SemaphoreHandlingError& e)
+    {
+        std::cout << "SocketSHM::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::MessageNotSent("Send() failed.")) ;
+    }
+
+     memcpy(_Shm_CS->GetShm(), Buffer, _Shm_CS->GetSize());
+
+     try {
+        _Sem_full_CS->V() ;
+     }
+     catch(certi::SemaphoreHandlingError& e)
+     {
+        std::cout << "SocketSHM::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::MessageNotSent("Send() failed.")) ;
+     }
+    }
+
+#ifdef DEBUG
+std::cout << "Send Complete !!" << std::endl ;
+#endif
+
+} // End of Send(...)
+
+// ************************************************
+// Method : SocketSHMS::Receive(...)
+// ************************************************
+void SocketSHM::Receive(void *Buffer) throw (certi::MessageNotReceived) {
+
+#ifdef DEBUG
+std::cout << "Try to Receive..." << std::endl ;
+#endif
+
+if(_Side == SHM_SC){
+    try {
+       _Sem_full_CS->P() ;
+    }
+    catch(certi::SemaphoreHandlingError& e)
+    {
+       std::cout << "SocketSHM::Receive() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+       throw (certi::MessageNotReceived("Receive() failed.")) ;
+    }
+
+    memcpy(Buffer, _Shm_CS->GetShm(), _Shm_CS->GetSize());
+
+    try {
+       _Sem_empty_CS->V() ;
+    }
+    catch(certi::SemaphoreHandlingError& e)
+    {
+       std::cout << "SocketSHM::Receive() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+       throw (certi::MessageNotReceived("Receive() failed.")) ;
+    }
+    }
+else{
+    try {
+       _Sem_full_SC->P() ;
+    }
+    catch(certi::SemaphoreHandlingError& e)
+    {
+       std::cout << "SocketSHM::Receive() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+       throw (certi::MessageNotReceived("Receive() failed.")) ;
+    }
+
+    memcpy( Buffer, _Shm_SC->GetShm(), _Shm_SC->GetSize());
+
+    try {
+       _Sem_empty_SC->V() ;
+    }
+    catch(certi::SemaphoreHandlingError& e)
+    {
+       std::cout << "SocketSHM::Receive() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+       throw (certi::MessageNotReceived("Receive() failed.")) ;
+    }
+    }
+
+#ifdef DEBUG
+std::cout << "Receive complete!!!" << std::endl ;
+#endif
+
+} // End of Receive(...)
+
+// ************************************************
+// Method : SocketSHM::Close()
+// ************************************************
+void SocketSHM::Close() throw(certi::SocketNotClosed) {
+
+#ifdef DEBUG
+std::cout << "Try to Close..." << std::endl ;
+#endif
+
+try {
+   _Shm_SC->Close() ;
+}
+catch (certi::SharedMemoryNotClosed& e)
+{
+    std::cout << "SocketSHM::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::SocketNotClosed("Close() failed.")) ;
+}
+catch (certi::HandleNotClosed& e)
+{
+    std::cout << "SocketSHM::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::SocketNotClosed("Close() failed.")) ;
+}
+try {
+   _Shm_CS->Close() ;
+}
+catch (certi::SharedMemoryNotClosed& e)
+{
+    std::cout << "SocketSHM::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::SocketNotClosed("Close() failed.")) ;
+}
+catch (certi::HandleNotClosed& e)
+{
+    std::cout << "SocketSHM::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::SocketNotClosed("Close() failed.")) ;
+}
+
+} // End of --> SocketSHM::Close()
+

Index: libCERTI/SemaphorePosix.hh
===================================================================
RCS file: libCERTI/SemaphorePosix.hh
diff -N libCERTI/SemaphorePosix.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SemaphorePosix.hh  16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,37 @@
+#ifndef SEMAPHORE_POSIX_H
+#define SEMAPHORE_POSIX_H
+
+// Posix Semaphores systems includes
+// Don't forget to add "-lrt" to compilation line
+#include <sys/types.h>
+#include <Semaphore.hh>
+#include <fcntl.h>
+
+// Others Systems includes
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <iostream>
+
+// Specifics includes
+#include "Semaphore.hh"
+#include <semaphore.h>
+
+class SemaphorePosix : public Semaphore {
+    private :
+    std::string _Semname ;
+    sem_t *_Sem ;
+
+    public :
+    SemaphorePosix() ;
+    virtual ~SemaphorePosix() ;
+    void Create_Init(const int initval, const std::string& New_Semname ) ;
+    void Attach(const std::string& New_Semname ) ;
+    void P() ;
+    void V() ;
+    void Delete() ;
+
+} ;
+
+#endif

Index: libCERTI/Semaphore.hh
===================================================================
RCS file: libCERTI/Semaphore.hh
diff -N libCERTI/Semaphore.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/Semaphore.hh       16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,34 @@
+#ifndef SEMAPHORE_H
+#define SEMAPHORE_H
+
+#include "certi.hh"
+#include "Exception.hh"
+// Systems includes
+#include <string>
+
+class CERTI_EXPORT Semaphore {
+
+protected:
+
+    public :
+    // Semaphore() ;
+    virtual ~Semaphore() {};
+    virtual void Create_Init(const int initval, const std::string& 
New_Semname) = 0 ;
+    virtual void Attach(const std::string& New_Semname ) = 0 ;
+    virtual void P() = 0 ;
+    virtual void V() = 0 ;
+    virtual void Delete() = 0 ;
+
+
+       /**
+        * Build a proper Semaphore name from a user provided name.
+        * Idea kindly borrowed from TSP (https://savannah.nongnu.org)
+        * bb_utils_build_sem_name
+        */
+       static std::string buildSemName(const std::string& SemName) {
+               return "/"+SemName+"_sem";
+       }
+
+} ;
+
+#endif

Index: libCERTI/SemaphorePosix.cc
===================================================================
RCS file: libCERTI/SemaphorePosix.cc
diff -N libCERTI/SemaphorePosix.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SemaphorePosix.cc  16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,111 @@
+#include "SemaphorePosix.hh"
+
+// ************************************************
+// Constructor
+// ************************************************
+SemaphorePosix::SemaphorePosix(){
+_Sem = NULL ;
+}
+
+// ************************************************
+// Destructor
+// ************************************************
+SemaphorePosix::~SemaphorePosix() {
+if (_Sem!=NULL) {
+  Delete() ;
+}
+}
+
+// ************************************************
+// Method : SemaphorePosix::Create_Init(...)
+// ************************************************
+void SemaphorePosix::Create_Init(const int initval, const std::string& 
New_Semname) {
+
+ _Semname.assign(New_Semname) ;
+sem_unlink(_Semname.c_str()) ;
+_Sem = sem_open( _Semname.c_str(), O_CREAT | O_EXCL , S_IRUSR | S_IWUSR 
,(int)initval) ;
+if(_Sem == SEM_FAILED) {
+     perror("Error with sem_open() in SemaphorePosix::Create_Init(...)") ; 
+     }
+
+#ifdef DEBUG
+int sem_val ;
+sem_getvalue(_Sem, &sem_val) ; 
+std::cout << "We create the semaphore identified by name : " << 
_Semname.c_str() << " with an init value : " <<  sem_val << std ::endl ; 
+#endif
+
+} // End of Create_Init(...)
+
+// ************************************************
+// Method : SemaphorePosix::Attach(...)
+// ************************************************
+void SemaphorePosix::Attach(const std::string& New_Semname) {
+
+ _Semname.assign(New_Semname) ;
+_Sem = sem_open( New_Semname.c_str(), O_CREAT ) ;  
+if(_Sem == SEM_FAILED){
+   perror("Error with sem_open() in SemaphorePosix::Attach(...)") ; 
+   } 
+
+#ifdef DEBUG
+int sem_val ;
+sem_getvalue(_Sem, &sem_val) ; 
+std::cout << "We attach the semaphore identified by name : " << 
_Semname.c_str() << " which have the value : " <<  sem_val << std ::endl ; 
+#endif
+} // End of Attach(...)
+
+// ************************************************
+// Method : SemaphorePosix::P()
+// ************************************************
+// Decrement Semaphore Value SV=SV-1 
+
+void SemaphorePosix::P() {
+
+#ifdef DEBUG
+int sem_val ;
+sem_getvalue(_Sem, &sem_val) ; 
+std::cout << "Begin of Operation P for the semaphore identified by name : " << 
_Semname << " which have the value : " << sem_val << std::endl ;
+#endif
+
+sem_wait(_Sem) ;
+
+#ifdef DEBUG
+sem_getvalue(_Sem, &sem_val) ;
+std::cout << "End of Operation P for the semaphore identified by name : " << 
_Semname << " which have the value : " << sem_val << std::endl ; 
+#endif
+
+} // End of P()
+
+
+// ************************************************
+// Methode : SemaphorePosix::V()
+// ************************************************
+// Increment Semaphore Value SV=SV+1 
+
+void SemaphorePosix::V() {
+
+#ifdef DEBUG
+int sem_val ;
+sem_getvalue(_Sem, &sem_val) ; 
+std::cout << "Begin of Operation V for the semaphore identified by name <" << 
_Semname << "> which have the value : " << sem_val << std::endl ;
+#endif
+
+sem_post(_Sem) ;
+
+#ifdef DEBUG
+sem_getvalue(_Sem, &sem_val) ;
+std::cout << "End of Operation V for the semaphore identified by name <" << 
_Semname << "> which have the value : " << sem_val << std::endl ; 
+#endif
+
+} // End of V()
+
+// ************************************************
+// Methode : SemaphorePosix::Delete()
+// ************************************************
+void SemaphorePosix::Delete(){
+
+sem_close(_Sem) ;
+sem_destroy(_Sem) ;
+
+} // End of Delete()
+

Index: libCERTI/SemaphoreWin32.hh
===================================================================
RCS file: libCERTI/SemaphoreWin32.hh
diff -N libCERTI/SemaphoreWin32.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SemaphoreWin32.hh  16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,40 @@
+#ifndef SEMAPHOREWIN32_H
+#define SEMAPHOREWIN32_H
+
+// Semaphores usefull systems includes
+#include <windows.h>
+#include <conio.h>
+#include <tchar.h>
+
+// Others systems includes
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <iostream>
+
+// Specifics includes
+#include "certi.hh"
+#include "Semaphore.hh"
+
+
+class CERTI_EXPORT SemaphoreWin32 : public Semaphore {
+    private :
+        HANDLE WINAPI _hSemaphore;
+
+    public :
+    SemaphoreWin32() ;
+    virtual ~SemaphoreWin32() ;
+    void Create_Init(const int initval, const std::string& New_Semname)
+                     throw(certi::SemaphoreNotCreated) ;
+    void Attach(const std::string& New_Semname )
+                throw(certi::SemaphoreNotOpen) ;
+    void P()
+         throw(certi::SemaphoreHandlingError) ;
+    void V()
+         throw(certi::SemaphoreHandlingError) ;
+    void Delete()
+         throw(certi::HandleNotClosed) ;
+
+} ;
+
+#endif

Index: libCERTI/SHMSysV.hh
===================================================================
RCS file: libCERTI/SHMSysV.hh
diff -N libCERTI/SHMSysV.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SHMSysV.hh 16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,68 @@
+#ifndef SHM_SYSV_H
+#define SHM_SYSV_H
+
+// SHMs useful systems includes
+#include <sys/types.h>
+#include <sys/ipc.h> 
+#include <sys/shm.h>
+
+// Others systems includes
+#include <fcntl.h>
+#include <math.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <iostream>
+#include <string.h>
+
+// Specifics includes
+#include "SHM.hh"
+
+class SHMSysV : public SHM {
+
+    private :
+    int _Id ;  
+    key_t _Key ; 
+   
+    public :
+    SHMSysV(const std::string& SHMName, const int SHMSize, const bool True) ;
+    SHMSysV(const std::string& SHMName, const int SHMSize) ;  
+    ~SHMSysV() ;
+    void Open() ;
+    void Attach() ;
+    void Close() ;
+
+        /**
+     * Build a SysV IPC key from a name and user specific value.
+     * The purpose of this function is to build a (quasi) unique
+     * key from unique entry as ftok(3) do with existing file name.
+     * We use SHA1 hash function Xored with the user_specific
+     * value supplied.
+     * @param[in] name, the name representing the IPC element for which
+     *                 we want a key.
+     * @param[in] user_specific_value, any user specific value
+     *                               (for example uid).
+     * @return The generated SysV IPC key corresponding to the specified entry
+     */
+    key_t
+    static ntokUser(const char* name, int32_t user_specific_value);
+
+    /**
+     * Build a SysV IPC key from a name.
+     * L'objectif de cette fonction est de generer des
+     * clefs differentes pour des noms differents, a la maniere
+     * d'une fonction de hachage ou checksum parfaite.
+     * Cette fonction vise les meme objectifs que ftok(3)
+     * avec les noms de fichiers mais avec une chaine
+     * de caractere quelconque.
+     * @param name un nom representant l'element IPC pour lequel on
+     *                veut generer une clef.
+     * @return SysV IPC key corresponding to the specified name.
+     */
+    key_t
+    static ntok(const char* name);
+
+
+} ;
+
+#endif

Index: libCERTI/SocketSHMPosix.cc
===================================================================
RCS file: libCERTI/SocketSHMPosix.cc
diff -N libCERTI/SocketSHMPosix.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SocketSHMPosix.cc  16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,106 @@
+#include "SocketSHMPosix.hh"
+
+// ************************************************
+// Constructor with args
+// ************************************************
+SocketSHMPosix ::SocketSHMPosix (const std::string& Socket_Name, 
+                                 const SHM_SIDE_t& Socket_Side,
+                                 const int Socket_Size ) : 
SocketSHM(Socket_Name,Socket_Side,Socket_Size) {
+std::string New_Name ;
+// SHMs
+if(_Side == SHM_SC){
+_Shm_SC = new SHMPosix(SHM::buildShmName(Socket_Name+"_SC"), Socket_Size, 
true) ;
+_Shm_CS = new SHMPosix(SHM::buildShmName(Socket_Name+"_CS"), Socket_Size) ;
+  }
+else {
+_Shm_CS = new SHMPosix(SHM::buildShmName(Socket_Name+"_CS"), Socket_Size, 
true) ;
+_Shm_SC = new SHMPosix(SHM::buildShmName(Socket_Name+"_SC"), Socket_Size) ;
+}
+
+// Semaphores
+
+_Sem_full_SC = new SemaphorePosix() ;
+_Sem_empty_SC = new SemaphorePosix() ;
+_Sem_full_CS = new SemaphorePosix() ;
+_Sem_empty_CS = new SemaphorePosix() ;
+
+int init_full = 0, init_empty = 1 ;
+if(_Side == SHM_SC){
+  _Sem_full_SC->Create_Init(init_full, 
Semaphore::buildSemName(Socket_Name+"_FULL_SC")) ;
+  _Sem_empty_SC->Create_Init(init_empty, 
Semaphore::buildSemName(Socket_Name+"_EMPTY_SC")) ;
+  }
+else{
+  _Sem_full_CS->Create_Init(init_full, 
Semaphore::buildSemName(Socket_Name+"_FULL_CS")) ;
+  _Sem_empty_CS->Create_Init(init_empty, 
Semaphore::buildSemName(Socket_Name+"_EMPTY_CS")) ;
+  }
+}
+// ************************************************
+// Destructor
+// ************************************************
+SocketSHMPosix ::~SocketSHMPosix() {
+
+if(_Side == SHM_SC){
+   _Sem_full_SC->Delete() ;
+   _Sem_empty_SC->Delete() ;
+   }
+
+else{
+   _Sem_full_CS->Delete() ;
+   _Sem_empty_CS->Delete() ;
+   } 
+
+delete _Sem_full_SC  ;
+delete _Sem_empty_SC  ;
+delete _Sem_full_CS  ;
+delete _Sem_empty_CS ;
+
+delete _Shm_SC ;
+delete _Shm_CS ;
+} // End of ~SocketSHMPosix()
+
+// ************************************************
+// Method : SocketSHMPosix::Open()
+// ************************************************
+void SocketSHMPosix::Open() {
+
+
+if(_Side == SHM_SC){
+    _Sem_empty_SC->P() ; 
+     _Shm_SC->Open() ;
+     _Shm_SC->Attach() ;
+    _Sem_empty_SC->V() ;
+    #ifdef DEBUG
+    std::cout << " The SHM from Server to Customer is Open " << std::endl ;
+    #endif
+     } 
+else{
+     _Sem_empty_CS->P() ;
+     _Shm_CS->Open() ;
+     _Shm_CS->Attach() ;
+     _Sem_empty_CS->V() ;
+     #ifdef DEBUG
+     std::cout << " The SHM from Customer to Server is Create and Attach" << 
std::endl ;
+     #endif
+     } 
+if(_Side == SHM_CS){
+     _Sem_empty_SC->P() ;  
+     _Shm_SC->Open() ;
+     _Shm_SC->Attach() ;
+     _Sem_empty_SC->V() ;
+     #ifdef DEBUG
+     std::cout << " The SHM from Server to Customer is identified and attached 
" << std::endl ;
+     #endif
+     } 
+else{
+     _Sem_empty_CS->P() ;  
+     _Shm_CS->Open() ;
+     _Shm_CS->Attach() ;
+     _Sem_empty_CS->V() ;
+     #ifdef DEBUG
+     std::cout << " The SHM from Customer to Server is identified and attached 
" << std::endl ;
+     #endif
+     } 
+
+} // End of Open()
+
+

Index: libCERTI/SHMPosix.hh
===================================================================
RCS file: libCERTI/SHMPosix.hh
diff -N libCERTI/SHMPosix.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SHMPosix.hh        16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,23 @@
+#ifndef SHM_POSIX_H
+#define SHM_POSIX_H
+
+// Specifics includes
+#include "SHM.hh"
+
+class SHMPosix : public SHM {
+
+    private :
+    int _Id ;  // identifiant du segment memoire affecté dans la methode : 
Open()
+   
+    public :
+    SHMPosix(const std::string& SHMName, const int SHMSize, const bool True) ;
+    SHMPosix(const std::string& SHMName, const int SHMSize) ;  
+    ~SHMPosix() ;
+
+    void Open() ;
+    void Attach() ;
+    void Close() ;
+
+} ;
+
+#endif

Index: libCERTI/SemaphoreSysV.hh
===================================================================
RCS file: libCERTI/SemaphoreSysV.hh
diff -N libCERTI/SemaphoreSysV.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SemaphoreSysV.hh   16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,64 @@
+#ifndef SEMAPHORESYSV_H
+#define SEMAPHORESYSV_H
+
+// Semaphores usefull systems includes
+#include <sys/types.h>
+#include <sys/ipc.h> 
+#include <sys/sem.h>
+
+// Others systems includes 
+#include <unistd.h>
+#include <cstdlib>
+#include <iostream>
+
+// Specifics includes
+#include "Semaphore.hh"
+
+
+class SemaphoreSysV : public Semaphore {
+    private :
+    int _Sem_Id ;
+    key_t _Sem_Key ;
+
+    public :
+    SemaphoreSysV() ;
+    virtual ~SemaphoreSysV() ;
+    void Create_Init(const int initval, const std::string& New_Semname) ;
+    void Attach(const std::string& New_Semname ) ;
+    void P() ;
+    void V() ;
+    void Delete() ;
+
+    /**
+     * Build a SysV IPC key from a name and user specific value.
+     * The purpose of this function is to build a (quasi) unique
+     * key from unique entry as ftok(3) do with existing file name.
+     * We use SHA1 hash function Xored with the user_specific
+     * value supplied.
+     * @param[in] name, the name representing the IPC element for which
+     *                 we want a key.
+     * @param[in] user_specific_value, any user specific value
+     *                               (for example uid).
+     * @return The generated SysV IPC key corresponding to the specified entry
+     */
+    key_t
+    static ntokUser(const char* name, int32_t user_specific_value);
+
+    /**
+     * Build a SysV IPC key from a name.
+     * L'objectif de cette fonction est de generer des
+     * clefs differentes pour des noms differents, a la maniere
+     * d'une fonction de hachage ou checksum parfaite.
+     * Cette fonction vise les meme objectifs que ftok(3)
+     * avec les noms de fichiers mais avec une chaine
+     * de caractere quelconque.
+     * @param name un nom representant l'element IPC pour lequel on
+     *                veut generer une clef.
+     * @return SysV IPC key corresponding to the specified name.
+     */
+    key_t
+    static ntok(const char* name);
+
+} ;
+
+#endif

Index: libCERTI/SocketSHM.hh
===================================================================
RCS file: libCERTI/SocketSHM.hh
diff -N libCERTI/SocketSHM.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SocketSHM.hh       16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,48 @@
+#ifndef SOCKET_SHM_H
+#define SOCKET_SHM_H
+
+#include <iostream>
+
+// Specifics includes
+#include "certi.hh"
+#include "Semaphore.hh"
+#include "SHM.hh"
+
+class CERTI_EXPORT SocketSHM {
+public :
+    // Typedef Side
+    typedef enum{SHM_SC,SHM_CS} SHM_SIDE_t ;
+
+    // Constructor
+    SocketSHM (const std::string& Socket_Name,
+               const SHM_SIDE_t& Socket_Side,
+               const int Socket_Size ) { _Name = Socket_Name ; _Side = 
Socket_Side ; _Size_Side = Socket_Size ; }
+    // Destructor
+    virtual ~SocketSHM () ;
+
+    virtual void Connect() throw (certi::SocketNotConnected) ;
+
+    virtual void Send(void *Buffer)
+                      throw (certi::MessageNotSent) ; // To send Data on a 
memory segment
+    virtual void Receive(void *Buffer)
+                      throw (certi::MessageNotReceived) ; // To receive Data 
on a memory segment
+
+    virtual void Close()
+                throw(certi::SocketNotClosed) ; // To Close the two SHMs
+
+protected :
+    std::string _Name ;
+    SHM_SIDE_t _Side ;
+    size_t _Size_Side ;
+
+    /***** Server -->>> Customer ******/
+    SHM *_Shm_SC ;
+    Semaphore *_Sem_full_SC, *_Sem_empty_SC ;
+
+    /***** Customer -->>> Server ******/
+    SHM *_Shm_CS ;
+    Semaphore *_Sem_full_CS, *_Sem_empty_CS ;
+
+}; // End of --> class SocketSHM
+
+#endif

Index: libCERTI/SocketSHMPosix.hh
===================================================================
RCS file: libCERTI/SocketSHMPosix.hh
diff -N libCERTI/SocketSHMPosix.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SocketSHMPosix.hh  16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,27 @@
+#ifndef SOCKET_SHM_POSIX_H
+#define SOCKET_SHM_POSIX_H
+
+// Specifics includes
+#include "SemaphorePosix.hh"
+#include "SHMPosix.hh"
+#include "SocketSHM.hh"
+#include "SHM.hh"
+#include "Semaphore.hh"
+
+class SocketSHMPosix : public SocketSHM {
+private:   
+
+public :
+    // Constructor
+    SocketSHMPosix (const std::string& Socket_Name, 
+                    const SHM_SIDE_t& Socket_Side,
+                    const int Socket_Size ); 
+    // Destructor
+    ~SocketSHMPosix (); 
+     
+    void Open();
+    
+
+}; // End of --> class SocketSHM
+
+#endif

Index: libCERTI/SHMPosix.cc
===================================================================
RCS file: libCERTI/SHMPosix.cc
diff -N libCERTI/SHMPosix.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SHMPosix.cc        16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,118 @@
+// SHM useful systems includes
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+
+// Others Systems includes
+#include <math.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <iostream>
+#include <string.h>
+
+#include "SHMPosix.hh"
+
+// ************************************************
+// Constructor with args
+// ************************************************
+SHMPosix::SHMPosix(const std::string& SHMName, const int SHMSize, const bool 
True)  : SHM(SHMName, SHMSize, True) { 
+    _Id = 0 ;  
+}
+
+SHMPosix::SHMPosix(const std::string& SHMName, const int SHMSize)  : 
SHM(SHMName,SHMSize) { 
+    _Id = 0 ;  
+}
+
+// ************************************************
+// Destructor
+SHMPosix::~SHMPosix() {}
+
+// ************************************************
+// Method : SHMPosix::Open()
+// ************************************************
+void SHMPosix::Open() {
+
+int ret ;
+
+ if (IsCreator()){
+    ret = shm_unlink(_Name.c_str());
+    _Id = shm_open(_Name.c_str(), O_CREAT | O_EXCL | O_RDWR , S_IRWXU | 
S_IRWXG);
+    if (_Id < 0) {
+        perror("Error with shm_open() in SHMPosix::Open()");
+        exit(1);
+        }
+#ifdef DEBUG
+std::cout <<  "Created shared memory object : " << _Name.c_str() << std::endl ;
+#endif
+
+    ret = ftruncate(_Id, _Size);
+     if (ret < 0) {
+        perror("In ftruncate()");
+        exit(1);
+        }
+
+ } // End of if IsCreator()
+ else{
+    _Id = shm_open(_Name.c_str(), O_RDONLY, S_IRWXU | S_IRWXG);
+    if (_Id < 0) {
+        perror("Error with shm_open() in SHMPosix::Open()");
+        exit(1);
+        }
+#ifdef DEBUG
+std::cout <<  "Attach shared memory object : " << _Name.c_str() << std::endl ;
+#endif
+ } // End of else IsCreator()
+
+} // End of Open()
+
+// ************************************************
+// Method : SHMPosix::Attach()
+// ************************************************
+void SHMPosix::Attach() {
+
+if (IsCreator()){
+    /* requesting the shared segment for write    --  mmap() */    
+    _Shm = mmap(NULL, _Size, PROT_READ | PROT_WRITE , MAP_SHARED, _Id, 0);
+    if (_Shm == NULL) {
+        perror("Error with mmap() in SHMPosix::Attach() ");
+        exit(1);}
+    if (_Shm == MAP_FAILED) {
+        perror("Error with mmap() in SHMPosix::Attach() ");
+        exit(1);}
+    close(_Id) ;
+} // End of IsServer
+else{
+ /* requesting the shared segment for write    --  mmap() */    
+    _Shm = mmap(NULL, _Size, PROT_READ , MAP_SHARED, _Id, 0);
+    if (_Shm == NULL) {
+        perror("Error with mmap() in SHMPosix::Attach() ");
+        exit(1);}
+    if (_Shm == MAP_FAILED) {
+        perror("Error with mmap() in SHMPosix::Attach() ");
+        exit(1);}
+    close(_Id) ;
+} // End of else (IsServer)
+} // End of Attach()
+
+// ************************************************
+// Method : SHMPosix::Close()
+// ************************************************
+void SHMPosix::Close() {
+
+// Close
+if (shm_unlink(_Name.c_str()) != 0) {
+    perror("Error with shm_unlink() in SHMPosix::Close() ");
+    exit(1);
+    }
+
+// Destroy
+if (IsCreator()){
+if(munmap(_Shm, _Size)){
+   perror("Error with munmap() in SHMPosix::Close() ");
+   exit(1);
+   } // End of if
+}
+
+} // End of Close()
+

Index: libCERTI/SemaphoreSysV.cc
===================================================================
RCS file: libCERTI/SemaphoreSysV.cc
diff -N libCERTI/SemaphoreSysV.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SemaphoreSysV.cc   16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,174 @@
+#include "SemaphoreSysV.hh"
+#include "sha1.h"
+#include <cstring>
+
+key_t SemaphoreSysV::ntokUser(const char* name, int32_t user_specific_value) {
+
+key_t s_key ;
+int32_t retcode ;
+
+SHA1Context sha ;
+ uint8_t Message_Digest[20] ;
+
+/* We use the first byte of a SHA1 hash of the BBname
+ * unless the algorithm fail.
+ * If SHA1 fail we go back to poor key generation method
+ * using the name length.
+ * In both case we must Xored the key with user_specific in order
+ * to isolate different user from using the same key
+ */
+         
+retcode  = SHA1Reset(&sha) ;
+retcode &= SHA1Input(&sha, (const unsigned char *) name,strlen(name)) ;
+retcode &= SHA1Result(&sha, Message_Digest);
+
+/* SHA 1 NOK back to old poor method */
+if (0 != retcode) {
+   s_key = ((strlen(name) << 16) & 0xFFFF0000) ^ (user_specific_value & 
0x0000FFFF);
+   } 
+else { s_key = (Message_Digest[0]        |
+       (Message_Digest[1] << 8) |
+       (Message_Digest[2] << 16)|
+       (Message_Digest[3] << 24)) ^
+        user_specific_value;
+       }
+       return s_key;
+}
+
+key_t SemaphoreSysV::ntok(const char* name) {
+       return SemaphoreSysV::ntokUser(name,getuid());
+        // return SemaphoreSysV::ntokUser(name,1);
+
+}
+// ************************************************
+// Constructor
+// ************************************************
+SemaphoreSysV::SemaphoreSysV(){
+_Sem_Id = 0 ;
+_Sem_Key = 0 ;
+}
+
+// ************************************************
+// Destructor
+// ************************************************
+SemaphoreSysV::~SemaphoreSysV() {}
+
+// ************************************************
+// Method : SemaphoreSysV::Create_Init(...)
+// ************************************************
+void SemaphoreSysV::Create_Init(const int initval, const std::string& 
New_Semname) {
+
+ _Sem_Key = ntok(New_Semname.c_str()) ;
+ _Sem_Id = semget(_Sem_Key,1,IPC_CREAT |0666);
+ if (_Sem_Id == -1){
+      perror("Error with semget() in SemaphoreSysV::Create_Init(...)") ;
+      exit(1) ;
+ }
+ #ifdef DEBUG
+ std::cout << "We create the semaphore identified by number : " << _Sem_Id << 
std::endl ;
+ #endif
+
+ union semun{
+     int val ;  
+   struct semid_ds *buf ; // Not use here
+   ushort *array; // Not use here       
+ } arg_ctl ;
+
+ // Initialize
+ arg_ctl.val = initval ;
+ if (semctl(_Sem_Id,0,SETVAL,arg_ctl) == -1){
+    perror("Error during semaphore initialization") ;
+    exit(1) ;
+        }
+ #ifdef DEBUG
+ std::cout <<"We init the semaphore with value : " << initval << std::endl ;
+ #endif
+
+} // End of method : Create_Init(...)
+
+// ************************************************
+// Method : SemaphoreSysV::Attach(...)
+// ************************************************
+void SemaphoreSysV::Attach(const std::string& New_Semname) {
+
+_Sem_Key = ntok(New_Semname.c_str()) ;
+_Sem_Id = semget(_Sem_Key,1,0666) ;
+if (_Sem_Id == -1) {
+      perror("Error with semget() in SemaphoreSysV::Attach(...)") ;
+      exit(1) ;
+      }
+ #ifdef DEBUG
+ std::cout <<  "We attach the semaphore identified by number : " << _Sem_Id << 
std::endl ;
+ #endif
+
+} // End of method : Attach(...)
+
+// ************************************************
+// Method : SemaphoreSysV::P
+// ************************************************
+// Decrement Semaphore Value SV=SV-1 
+
+void SemaphoreSysV::P() {
+
+#ifdef DEBUG
+std::cout << "Begin of Operation P for the semaphore identified by number : " 
<< _Sem_Id << std::endl ;
+#endif
+
+struct sembuf semparP ;
+  semparP.sem_num = 0 ;
+  semparP.sem_op = -1 ;
+  semparP.sem_flg = SEM_UNDO ;
+
+ if (semop(_Sem_Id,&semparP,1) == -1) {
+    perror("Error with semop() in SemaphoreSysV::P()") ;
+    exit(1);
+    } 
+
+#ifdef DEBUG
+std::cout << "End of Operation P for the semaphore identified by number : " << 
_Sem_Id << std::endl  ;
+#endif
+
+} // End of P()
+
+
+// ************************************************
+// Method : SemaphoreSysV::V
+// ************************************************
+// Increment Semaphore Value SV=SV+1 
+
+void SemaphoreSysV::V() {
+
+#ifdef DEBUG
+std::cout << "Begin of Operation V for the semaphore identified by number : " 
<< _Sem_Id << std::endl ;
+#endif
+
+struct sembuf semparV ;
+  semparV.sem_num = 0 ;
+  semparV.sem_op = 1 ;
+  semparV.sem_flg = SEM_UNDO ;
+
+  if (semop(_Sem_Id,&semparV,1) ==-1) {
+    perror("Error with semop() in SemaphoreSysV::V() ") ;
+    exit(1);
+    } 
+
+#ifdef DEBUG
+std::cout << "End of Operation V for the semaphore identified by number : " << 
_Sem_Id << std::endl  ;
+#endif
+
+} // End of V()
+
+// ************************************************
+// Method : SemaphoreSysV::Delete
+// ************************************************
+void SemaphoreSysV::Delete(){
+
+#ifdef DEBUG
+std::cout << "Destroy the semaphore identified by number : " << _Sem_Id << 
std::endl ;
+#endif
+
+if(semctl(_Sem_Id,0,IPC_RMID,0) == -1)
+    perror("Error with semctl() in SemaphoreSysV::Delete()") ;
+
+} // End of Delete()
+

Index: libCERTI/SocketSHMSysV.hh
===================================================================
RCS file: libCERTI/SocketSHMSysV.hh
diff -N libCERTI/SocketSHMSysV.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SocketSHMSysV.hh   16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,24 @@
+#ifndef SOCKET_SHM_SYSV_H
+#define SOCKET_SHM_SYSV_H
+
+// Specifics includes
+#include "SemaphoreSysV.hh"
+#include "SHMSysV.hh"
+#include "SocketSHM.hh"
+
+class SocketSHMSysV : public SocketSHM {
+private:    
+
+public :
+    // Constructor
+    SocketSHMSysV (const std::string& Socket_Name, 
+                   const SHM_SIDE_t& Socket_Side,
+                   const int Socket_size );  
+    // Destructor
+    ~SocketSHMSysV (); 
+     
+    void Open();
+   
+}; // End of --> class SocketSHM
+
+#endif

Index: libCERTI/SHMSysV.cc
===================================================================
RCS file: libCERTI/SHMSysV.cc
diff -N libCERTI/SHMSysV.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SHMSysV.cc 16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,117 @@
+#include "SHMSysV.hh"
+#include "sha1.h"
+
+key_t SHMSysV::ntokUser(const char* name, int32_t user_specific_value) {
+
+key_t s_key ;
+int32_t retcode ;
+
+SHA1Context sha ;
+ uint8_t Message_Digest[20] ;
+
+/* We use the first byte of a SHA1 hash of the BBname
+ * unless the algorithm fail.
+ * If SHA1 fail we go back to poor key generation method
+ * using the name length.
+ * In both case we must Xored the key with user_specific in order
+ * to isolate different user from using the same key
+ */
+         
+retcode  = SHA1Reset(&sha) ;
+retcode &= SHA1Input(&sha, (const unsigned char *) name,strlen(name)) ;
+retcode &= SHA1Result(&sha, Message_Digest);
+
+/* SHA 1 NOK back to old poor method */
+if (0 != retcode) {
+   s_key = ((strlen(name) << 16) & 0xFFFF0000) ^ (user_specific_value & 
0x0000FFFF);
+   } 
+else { s_key = (Message_Digest[0]        |
+       (Message_Digest[1] << 8) |
+       (Message_Digest[2] << 16)|
+       (Message_Digest[3] << 24)) ^
+        user_specific_value;
+       }
+       return s_key;
+}
+
+key_t
+SHMSysV::ntok(const char* name) {
+       return SHMSysV::ntokUser(name,getuid());
+        // return SHMSysV::ntokUser(name,1);
+}
+
+
+// ************************************************
+// Constructors with args
+// ************************************************
+SHMSysV::SHMSysV(const std::string& SHMName, const int SHMSize, const bool 
True)  : SHM(SHMName, SHMSize, True) { 
+    _Key = ntok(SHMName.c_str());
+
+#ifdef DEBUG
+std::cout << " Cle produite : " << _Key << std::endl ;
+#endif
+
+    _Id = 0 ;  
+}
+
+SHMSysV::SHMSysV(const std::string& SHMName, const int SHMSize)  : 
SHM(SHMName, SHMSize) { 
+     _Key = ntok(SHMName.c_str());
+
+#ifdef DEBUG
+std::cout << " Cle produite : " << _Key << std::endl ;
+#endif
+
+    _Id = 0 ;  
+}
+
+
+// ************************************************
+// Destructor
+// ************************************************
+SHMSysV::~SHMSysV() {}
+
+// ************************************************
+// Method : SHMSysV::Open()
+// ************************************************
+void SHMSysV::Open() {
+
+if ((_Id = shmget(_Key, (size_t)_Size, IPC_CREAT| 0666 )) < 0){  
+    perror("Error with shmget in SHMSysV::Open()"); 
+    exit(1);
+    } // End of if
+
+} // End of Open()
+
+// ************************************************
+// Method : SHMSysV::Attach()
+// ************************************************
+void SHMSysV::Attach() {
+
+if ( ( _Shm = shmat(_Id, NULL, 0) ) == (void*) -1){
+    perror("Error with shmat() in SHMSysV::Attach() "); 
+    exit(1);
+    } // End of if
+
+} // End of Attach(...)
+
+// ************************************************
+// Method : Close()
+// ************************************************
+void SHMSysV::Close() {
+
+// Close
+if(shmdt(_Shm)){
+        perror("Error with shmdt() in SHMSysV::Close()");
+        exit(1);
+      } // End of if(shmdt(_Shm))
+
+if(_IsCreator){
+// Destroy
+if(shmctl(_Id, IPC_RMID,0)){
+   perror("Error with shmctl() in SHMSysV::Close()");
+   exit(1);
+   } // End of if(shmctl(_Shm_Id, IPC_RMID,0))
+} // End of (_IsServer)
+
+} // End of Close()
+

Index: libCERTI/RingBuffer.cc
===================================================================
RCS file: libCERTI/RingBuffer.cc
diff -N libCERTI/RingBuffer.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/RingBuffer.cc      16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,799 @@
+// ----------------------------------------------------------------------------
+// CERTI - HLA RunTime Infrastructure
+// Copyright (C) 2002-2005  ONERA
+//
+// This program is free software ; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation ; either version 2 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY ; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program ; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA
+// ----------------------------------------------------------------------------
+
+// Systems includes
+#include <limits>
+#include <string.h>
+// Specifics includes
+#ifdef _WIN32
+   #include <windows.h>
+   #include <process.h>
+   #include "SocketSHMWin32.hh"
+   #include "SemaphoreWin32.hh"
+   #include "SHMWin32.hh"
+#else
+   #include "SemaphorePosix.hh"
+   #include "SHMPosix.hh"
+   #include "SemaphoreSysV.hh"
+   #include "SHMSysV.hh"
+#endif
+
+#include "RingBuffer.hh"
+
+RingBuffer::RingBuffer(const std::string& RingBuffer_Name,
+                          const BUFFER_SIDE_t& RingBuffer_Side,
+                       const int RingBuffer_Size,
+                       const std::string& Shm_Sem_Type )
+                       throw (certi::RingBufferNotCreated) {
+
+#ifdef DEBUG
+std::cout << "-----------------------------------------------------------" << 
std::endl ;
+std::cout << " ----------------------- RingBuffer -----------------------"<< 
std::endl ;
+std::cout << "-----------------------------------------------------------" << 
std::endl ;
+#endif
+
+_Name = RingBuffer_Name ;
+_Side = RingBuffer_Side ;
+_Size = RingBuffer_Size ;
+
+_Tab_SC = new int[3] ;
+_Tab_SC[0] = RingBuffer_Size ;
+_Tab_SC[1] = 0 ;
+_Tab_SC[2] = 0 ;
+
+_Tab_CS = new int[3] ;
+_Tab_CS[0] = RingBuffer_Size ;
+_Tab_CS[1] = 0 ;
+_Tab_CS[2] = 0 ;
+
+#ifndef _WIN32
+if (Shm_Sem_Type == "SysV"){
+   _Sem_CS = new SemaphoreSysV() ;
+   _Sem_SC = new SemaphoreSysV() ;
+   }
+else if (Shm_Sem_Type == "Posix"){
+   _Sem_CS = new SemaphorePosix() ;
+   _Sem_SC = new SemaphorePosix() ;
+   }
+else{
+    perror("Shm_Sem_Type Must be Posix or SysV") ;
+    exit(1) ;
+    }
+#else
+   _Sem_CS = new SemaphoreWin32() ;
+   _Sem_SC = new SemaphoreWin32() ;
+#endif
+
+
+if(_Side == BUFFER_SC){
+    try {
+       _Sem_SC->Create_Init(1, 
Semaphore::buildSemName(RingBuffer_Name+"_BUFFER_SC")) ;
+    }
+    catch(certi::SemaphoreNotCreated& e)
+    {
+        std::cout << "RingBuffer::RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotCreated("RingBuffer() failed.")) ;;
+    }
+  }
+else{
+    try {
+       _Sem_CS->Create_Init(1, 
Semaphore::buildSemName(RingBuffer_Name+"_BUFFER_CS")) ;
+    }
+    catch(certi::SemaphoreNotCreated& e)
+    {
+        std::cout << "RingBuffer::RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotCreated("RingBuffer() failed.")) ;;
+    }
+  }
+
+
+if(_Side == BUFFER_SC){
+#ifndef _WIN32
+     if (Shm_Sem_Type == "SysV"){
+         _Shm_SC = new 
SHMSysV(SHM::buildShmName(RingBuffer_Name+"_BUFFER_SC"), RingBuffer_Size,true) ;
+         _Shm_CS = new 
SHMSysV(SHM::buildShmName(RingBuffer_Name+"_BUFFER_CS"), RingBuffer_Size) ;
+         _Pw_Pr_SC = new SHMSysV(SHM::buildShmName(RingBuffer_Name+"_IND_SC"), 
3 * sizeof(int) , true) ;
+         _Pw_Pr_CS = new SHMSysV(SHM::buildShmName(RingBuffer_Name+"_IND_CS"), 
3 * sizeof(int)) ;
+         }
+     if (Shm_Sem_Type == "Posix"){
+         _Shm_SC = new 
SHMPosix(SHM::buildShmName(RingBuffer_Name+"_BUFFER_SC"), RingBuffer_Size,true) 
;
+         _Shm_CS = new 
SHMPosix(SHM::buildShmName(RingBuffer_Name+"_BUFFER_CS"), RingBuffer_Size) ;
+         _Pw_Pr_SC = new 
SHMPosix(SHM::buildShmName(RingBuffer_Name+"_IND_SC"), 3 * sizeof(int) , true) ;
+         _Pw_Pr_CS = new 
SHMPosix(SHM::buildShmName(RingBuffer_Name+"_IND_CS"), 3 * sizeof(int)) ;
+         }
+#else
+         _Shm_SC = new 
SHMWin32(SHM::buildShmName(RingBuffer_Name+"_BUFFER_SC"), RingBuffer_Size,true) 
;
+         _Shm_CS = new 
SHMWin32(SHM::buildShmName(RingBuffer_Name+"_BUFFER_CS"), RingBuffer_Size) ;
+         _Pw_Pr_SC = new 
SHMWin32(SHM::buildShmName(RingBuffer_Name+"_IND_SC"), 3 * sizeof(int) , true) ;
+         _Pw_Pr_CS = new 
SHMWin32(SHM::buildShmName(RingBuffer_Name+"_IND_CS"), 3 * sizeof(int)) ;
+#endif
+  }
+else {
+#ifndef _WIN32
+     if (Shm_Sem_Type == "SysV"){
+       _Shm_CS = new SHMSysV(SHM::buildShmName(RingBuffer_Name+"_BUFFER_CS"), 
RingBuffer_Size, true) ;
+       _Shm_SC = new SHMSysV(SHM::buildShmName(RingBuffer_Name+"_BUFFER_SC"), 
RingBuffer_Size) ;
+       _Pw_Pr_CS = new SHMSysV(SHM::buildShmName(RingBuffer_Name+"_IND_CS"), 3 
* sizeof(int), true) ;
+       _Pw_Pr_SC = new SHMSysV(SHM::buildShmName(RingBuffer_Name+"_IND_SC"), 3 
* sizeof(int)) ;
+       }
+     if (Shm_Sem_Type == "Posix"){
+       _Shm_CS = new SHMPosix(SHM::buildShmName(RingBuffer_Name+"_BUFFER_CS"), 
RingBuffer_Size, true) ;
+       _Shm_SC = new SHMPosix(SHM::buildShmName(RingBuffer_Name+"_BUFFER_SC"), 
RingBuffer_Size) ;
+       _Pw_Pr_CS = new SHMPosix(SHM::buildShmName(RingBuffer_Name+"_IND_CS"), 
3 * sizeof(int), true) ;
+       _Pw_Pr_SC = new SHMPosix(SHM::buildShmName(RingBuffer_Name+"_IND_SC"), 
3 * sizeof(int)) ;
+       }
+#else
+     if (Shm_Sem_Type == "Win32"){
+       _Shm_CS = new SHMWin32(SHM::buildShmName(RingBuffer_Name+"_BUFFER_CS"), 
RingBuffer_Size, true) ;
+       _Shm_SC = new SHMWin32(SHM::buildShmName(RingBuffer_Name+"_BUFFER_SC"), 
RingBuffer_Size) ;
+       _Pw_Pr_CS = new SHMWin32(SHM::buildShmName(RingBuffer_Name+"_IND_CS"), 
3 * sizeof(int), true) ;
+       _Pw_Pr_SC = new SHMWin32(SHM::buildShmName(RingBuffer_Name+"_IND_SC"), 
3 * sizeof(int)) ;
+       }
+#endif
+}
+
+if(_Side == BUFFER_SC){
+    try {
+       _Shm_SC->Open() ;
+    }
+    catch(certi::SharedMemoryNotOpen& e)
+    {
+        std::cout << "RingBuffer::RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotCreated("RingBuffer() failed.")) ;;
+    }
+    try {
+       _Shm_SC->Attach() ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "RingBuffer::RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotCreated("RingBuffer() failed.")) ;;
+    }
+    try {
+       _Pw_Pr_SC->Open() ;
+    }
+    catch(certi::SharedMemoryNotOpen& e)
+    {
+        std::cout << "RingBuffer::RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotCreated("RingBuffer() failed.")) ;;
+    }
+    try {
+       _Pw_Pr_SC->Attach() ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "RingBuffer::RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotCreated("RingBuffer() failed.")) ;;
+    }
+
+    #ifdef DEBUG
+    std::cout << " The SHMs for RingBuffer from SERVER to CUSTOMER Exchange 
are Created and Attached " << std::endl ;
+    std::cout << " -----> Adresse : _Shm_SC->GetShm() = " << _Shm_SC->GetShm() 
<< std::endl ;
+    std::cout << " -----> Adresse : _Pw_Pr_SC->GetShm() = " << 
_Pw_Pr_SC->GetShm() << std::endl ;
+    #endif
+     }
+else{
+    try {
+       _Shm_CS->Open() ;
+    }
+    catch(certi::SharedMemoryNotOpen& e)
+    {
+        std::cout << "RingBuffer::RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotCreated("RingBuffer() failed.")) ;;
+    }
+    try {
+       _Shm_CS->Attach() ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "RingBuffer::RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotCreated("RingBuffer() failed.")) ;;
+    }
+    try {
+       _Pw_Pr_CS->Open() ;
+    }
+    catch(certi::SharedMemoryNotOpen& e)
+    {
+        std::cout << "RingBuffer::RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotCreated("RingBuffer() failed.")) ;;
+    }
+    try {
+       _Pw_Pr_CS->Attach() ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "RingBuffer::RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotCreated("RingBuffer() failed.")) ;;
+    }
+
+     #ifdef DEBUG
+     std::cout << " The SHMs for RingBuffer from CUSTOMER to SERVER Exchanges 
are Created and Attached" << std::endl ;
+     std::cout << "  -----> Adresse : _Shm_CS->GetShm() = " << 
_Shm_CS->GetShm() << std::endl ;
+     std::cout << "  -----> Adresse : _Pw_Pr_CS->GetShm() = " << 
_Pw_Pr_CS->GetShm() << std::endl ;
+     #endif
+
+     }
+}  // End of RingBuffer Constructor
+// ************************************************
+// Method : RingBuffer::Attach()
+// ************************************************
+void RingBuffer::Attach() throw(certi::RingBufferNotAttached) {
+
+if(_Side == BUFFER_CS){
+    try {
+       _Sem_SC->Attach(Semaphore::buildSemName(_Name+"_BUFFER_SC")) ;
+    }
+    catch(certi::SemaphoreNotOpen& e)
+    {
+        std::cout << "RingBuffer::Attach() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotAttached("Attach() failed.")) ;;
+    }
+  }
+else{
+    try {
+       _Sem_CS->Attach(Semaphore::buildSemName(_Name+"_BUFFER_CS")) ;
+    }
+    catch(certi::SemaphoreNotOpen& e)
+    {
+        std::cout << "RingBuffer::Attach() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotAttached("Attach() failed.")) ;;
+    }
+  }
+
+if(_Side == BUFFER_CS){
+    try {
+       _Shm_SC->Open() ;
+    }
+    catch(certi::SharedMemoryNotOpen& e)
+    {
+        std::cout << "RingBuffer::Attach() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotAttached("Attach() failed.")) ;;
+    }
+    try {
+       _Shm_SC->Attach() ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "RingBuffer::Attach() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotAttached("Attach() failed.")) ;;
+    }
+    try {
+       _Pw_Pr_SC->Open() ;
+    }
+    catch(certi::SharedMemoryNotOpen& e)
+    {
+        std::cout << "RingBuffer::Attach() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotAttached("Attach() failed.")) ;;
+    }
+    try {
+       _Pw_Pr_SC->Attach() ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "RingBuffer::Attach() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotAttached("Attach() failed.")) ;;
+    }
+
+     #ifdef DEBUG
+     std::cout << " The SHMs for RingBuffer from SERVER to CUSTOMER Exchanges 
are Identified and Attached " << std::endl ;
+     std::cout << " Adresse : _Shm_SC->GetShm() = " << _Shm_SC->GetShm() << 
std::endl ;
+     std::cout << " Adresse : _Pw_Pr_SC->GetShm() = " << _Pw_Pr_SC->GetShm() 
<< std::endl ;
+     #endif
+
+     }
+else{
+    try {
+       _Shm_CS->Open() ;
+    }
+    catch(certi::SharedMemoryNotOpen& e)
+    {
+        std::cout << "RingBuffer::Attach() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotAttached("Attach() failed.")) ;;
+    }
+    try {
+       _Shm_CS->Attach() ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "RingBuffer::Attach() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotAttached("Attach() failed.")) ;;
+    }
+    try {
+       _Pw_Pr_CS->Open() ;
+    }
+    catch(certi::SharedMemoryNotOpen& e)
+    {
+        std::cout << "RingBuffer::Attach() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotAttached("Attach() failed.")) ;;
+    }
+    try {
+       _Pw_Pr_CS->Attach() ;
+    }
+    catch(certi::SharedMemoryNotAttached& e)
+    {
+        std::cout << "RingBuffer::Attach() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotAttached("Attach() failed.")) ;;
+    }
+
+     #ifdef DEBUG
+     std::cout << " The SHMs for RingBuffer from CUSTOMER to SERVER Exchanges 
are Identified and Attached " << std::endl ;
+     std::cout << " Adresse : _Shm_CS->GetShm() = " << _Shm_CS->GetShm() << 
std::endl ;
+     std::cout << " Adresse : _Pw_Pr_CS->GetShm() = " << _Pw_Pr_CS->GetShm() 
<< std::endl ;
+     #endif
+
+     }
+
+if(_Side == BUFFER_CS){
+    memcpy(_Pw_Pr_CS->GetShm(), _Tab_CS, 3 * sizeof(int) ) ;
+     }
+else{
+    memcpy(_Pw_Pr_SC->GetShm(), _Tab_SC, 3 * sizeof(int) ) ;
+     }
+
+} // End of RingBuffer::Attach()
+
+// ************************************************
+// Destructor
+// ************************************************
+RingBuffer ::~RingBuffer () throw(certi::RingBufferNotDeleted) {
+if(_Side == BUFFER_SC){
+    try {
+       _Sem_SC->Delete() ;
+    }
+    catch(certi::HandleNotClosed& e)
+    {
+        std::cout << "RingBuffer::~RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotDeleted("~RingBuffer() failed.")) ;;
+    }
+   }
+else{
+    try {
+       _Sem_CS->Delete() ;
+    }
+    catch(certi::HandleNotClosed& e)
+    {
+        std::cout << "RingBuffer::~RingBuffer() Exception. " <<  "Name is : " 
<< e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::RingBufferNotDeleted("~RingBuffer() failed.")) ;;
+    }
+   }
+
+delete _Sem_SC  ;
+delete _Sem_CS  ;
+delete _Shm_SC ;
+delete _Shm_CS ;
+delete _Pw_Pr_SC ;
+delete _Pw_Pr_CS ;
+} // End of RingBuffer Destructor
+
+// ************************************************
+// Method : RingBuffer::Send(...)
+// ************************************************
+void RingBuffer::Send(void *Buffer, size_t Size)
+                      throw (certi::MessageNotSent,
+                             certi::MessageTooLong,
+                             certi::BufferFull) {
+
+#ifdef DEBUG
+std::cout << "RingBuffer --> Try to Send..." << std::endl ;
+#endif
+
+if (Size > _Size) {
+   throw(certi::MessageTooLong("RingBuffer::Send() failed.")) ;
+   }
+
+if(_Side == BUFFER_SC){
+   try {
+      _Sem_SC->P() ;
+   }
+   catch(certi::SemaphoreHandlingError& e)
+   {
+        std::cout << "RingBuffer::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::MessageNotSent("RingBuffer::Send() failed.")) ;;
+   }
+
+   memcpy(_Tab_SC, _Pw_Pr_SC->GetShm(), 3 * sizeof(int) ) ;
+
+    #ifdef DEBUG
+    std::cout << "RingBuffer::Send(...) --> BEGIN Algorithm : Count_SC = " << 
_Tab_SC[0] << " | Write_SC = " << _Tab_SC[1] << "| Read_SC = " << _Tab_SC[2] << 
std::endl ;
+    #endif
+
+    if (Size > _Tab_SC[0]) { // Test si il y a assez de place disponible dans 
le buffer (Exeption à envoyer)
+       try {
+        _Sem_SC->V() ;
+       }
+       catch(certi::SemaphoreHandlingError& e)
+       {
+          std::cout << "RingBuffer::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+          throw (certi::MessageNotSent("RingBuffer::Send() failed.")) ;;
+       }
+       throw(certi::BufferFull("RingBuffer::Send() failed.")) ;
+    }
+
+    if ( (_Tab_SC[2] > _Tab_SC[1]) || ((_Tab_SC[1] >= _Tab_SC[2]) && (Size + 
_Tab_SC[1] <= _Size)) ) {
+    //  Plecture >= Pecriture || Pecriture >= Plecture && Taille a ecrire + 
Pecriture <=TailleTotaleSegment
+
+        #ifdef DEBUG
+        std::cout << "RingBuffer::Send(...) --> Utilisation memcpy Simple " << 
std::endl ;
+        std::cout << "RingBuffer::Send(...) --> Adresse Utilisee  
_Shm_SC->GetShm() = " << _Shm_SC->GetShm() << "| _Shm_SC->GetShm() + _Tab_SC[1] 
= " << (void *)((char *)(_Shm_SC->GetShm()) + (sizeof(void *) * _Tab_SC[1])) << 
std::endl ;
+        #endif
+
+        memcpy((void *)((char *)(_Shm_SC->GetShm())+ (sizeof(void *) * 
_Tab_SC[1])) , Buffer, Size) ;
+
+        _Tab_SC[0] -= Size ;
+        _Tab_SC[1] = (_Tab_SC[1] + Size) % _Size ;
+        }
+   else {
+        #ifdef DEBUG
+        std::cout << "RingBuffer::Send(...) --> Utilisation memcpy Double " << 
std::endl ;
+        #endif
+
+        int Rest_byte_in_SHM =  _Size - _Tab_SC[1] ;
+
+        memcpy((void *)((char *)(_Shm_SC->GetShm())+ (sizeof(void *) * 
_Tab_SC[1])), Buffer, Rest_byte_in_SHM ) ;
+
+        memcpy(_Shm_SC->GetShm(), (void *)((char *)(Buffer) + (sizeof(void *) 
* Rest_byte_in_SHM)), Size - Rest_byte_in_SHM ) ;
+
+        _Tab_SC[1] = (_Tab_SC[1] + Size) % _Size ;
+        _Tab_SC[0] -= Size ;
+
+        } // Fin du if ((_Tab_SC[2] >= _Tab_SC[1]) ...) /else
+
+     #ifdef DEBUG
+     std::cout << "RingBuffer::Send(...) --> END of Algorithm : Count_SC = "  
<< _Tab_SC[0] << " | Write_SC = " << _Tab_SC[1] << "| Read_SC = " << _Tab_SC[2] 
<< std::endl ;
+     #endif
+
+     memcpy(_Pw_Pr_SC->GetShm(), _Tab_SC, 3 * sizeof(int) ) ;
+
+     try {
+        _Sem_SC->V() ;
+     }
+     catch(certi::SemaphoreHandlingError& e)
+     {
+        std::cout << "RingBuffer::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::MessageNotSent("RingBuffer::Send() failed.")) ;;
+     }
+     }
+else{
+    try {
+       _Sem_CS->P() ;
+    }
+    catch(certi::SemaphoreHandlingError& e)
+    {
+       std::cout << "RingBuffer::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+       throw (certi::MessageNotSent("RingBuffer::Send() failed.")) ;;
+    }
+
+    memcpy(_Tab_CS, _Pw_Pr_CS->GetShm(), 3 * sizeof(int) ) ;
+
+    #ifdef DEBUG
+    std::cout << "RingBuffer::Send(...) --> BEGIN Algorithm : Count_CS = " << 
_Tab_CS[0] << " | Write_CS = " << _Tab_CS[1] << "| Read_CS = " << _Tab_CS[2] << 
std::endl ;
+    #endif
+
+    if (Size > _Tab_CS[0]) { // Test si il y a assez de place disponible dans 
le buffer
+       try {
+          _Sem_CS->V() ;
+       }
+       catch(certi::SemaphoreHandlingError& e)
+       {
+          std::cout << "RingBuffer::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+          throw (certi::MessageNotSent("RingBuffer::Send() failed.")) ;;
+       }
+       throw(certi::BufferFull("RingBuffer::Send() failed.")) ;
+    }
+
+    if ( (_Tab_CS[2] > _Tab_CS[1]) || ((_Tab_CS[1] >= _Tab_CS[2]) && (Size + 
_Tab_CS[1] <= _Size)) ) {
+    //  Plecture >= Pecriture || Pecriture >= Plecture && Taille a ecrire + 
Pecriture <=TailleTotaleSegment
+
+        #ifdef DEBUG
+        std::cout << "RingBuffer::Send(...) --> Utilisation memcpy Simple " << 
std::endl ;
+        std::cout << "RingBuffer::Send(...) --> Adresse Utilisee  
_Shm_CS->GetShm() = " <<  _Shm_CS->GetShm() << "| _Shm_CS->GetShm() + 
_Tab_CS[1] = " << (void *)((char *)(_Shm_CS->GetShm())+ (sizeof(void *) * 
_Tab_CS[1])) << std::endl ;
+        #endif
+
+        memcpy((void *)((char *)(_Shm_CS->GetShm())+ (sizeof(void *) * 
_Tab_CS[1])) , Buffer, Size) ;
+
+        _Tab_CS[0] -= Size ;
+        _Tab_CS[1] = (_Tab_CS[1] + Size) % _Size ;
+        }
+   else {
+        #ifdef DEBUG
+        std::cout << "RingBuffer::Send(...) --> Utilisation memcpy Double " << 
std::endl ;
+        #endif
+
+        int Rest_byte_in_SHM =  _Size - _Tab_CS[1] ;
+
+        memcpy((void *)((char *)(_Shm_CS->GetShm())+ (sizeof(void *) * 
_Tab_CS[1])), Buffer, Rest_byte_in_SHM ) ;
+
+        memcpy(_Shm_CS->GetShm(), (void *)((char *)(Buffer) + (sizeof(void *) 
* Rest_byte_in_SHM)), Size - Rest_byte_in_SHM ) ;
+
+         _Tab_CS[1] = (_Tab_CS[1] + Size) % _Size ;
+
+         _Tab_CS[0] -= Size ;
+
+       }
+
+      #ifdef DEBUG
+      std::cout << "RingBuffer::Send(...) --> END of Algorithm : Count_CS = " 
<< _Tab_CS[0] << " | Write_CS = " << _Tab_CS[1] << "| Read_CS = " << _Tab_CS[2] 
<< std::endl ;
+      #endif
+
+     memcpy(_Pw_Pr_CS->GetShm(), _Tab_CS, 3 * sizeof(int) ) ;
+
+     try {
+        _Sem_CS->V() ;
+     }
+     catch(certi::SemaphoreHandlingError& e)
+     {
+        std::cout << "RingBuffer::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+        throw (certi::MessageNotSent("RingBuffer::Send() failed.")) ;;
+     }
+     }
+
+#ifdef DEBUG
+std::cout << "RingBuffer --> Send Complete !!" << std::endl ;
+#endif
+
+} // End of RingBuffer::Send(...)
+
+// ************************************************
+// Method : RingBuffer::Receive(...)
+// ************************************************
+void RingBuffer::Receive(void *Buffer, size_t Size)
+                         throw (certi::MessageNotReceived,
+                                certi::MessageTooLong,
+                                certi::BufferEmpty) {
+
+#ifdef DEBUG
+std::cout << "RingBuffer -->  Try to Receive..." << std::endl ;
+#endif
+
+if (Size > _Size) {
+   throw(certi::MessageTooLong("RingBuffer::Receive() failed.")) ;
+   }
+
+if(_Side == BUFFER_SC){
+    try {
+       _Sem_CS->P() ;
+    }
+    catch(certi::SemaphoreHandlingError& e)
+    {
+       std::cout << "RingBuffer::Receive() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+       throw (certi::MessageNotReceived("RingBuffer::Receive() failed.")) ;;
+    }
+
+    memcpy(_Tab_CS, _Pw_Pr_CS->GetShm(), 3 * sizeof(int) ) ;
+
+    if (_Tab_CS[0] == _Size ) { // Test si il y a assez de place disponible 
dans le buffer (Exeption à envoyer)
+       try {
+          _Sem_CS->V() ;
+       }
+       catch(certi::SemaphoreHandlingError& e)
+       {
+          std::cout << "RingBuffer::Send() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+          throw (certi::MessageNotReceived("RingBuffer::Receive() failed.")) ;;
+       }
+       throw(certi::BufferEmpty("RingBuffer::Receive() failed.")) ;
+
+       #ifdef DEBUG
+       std::cout << "lllll RingBuffer::Receive(...) --> Nothing to Read on 
_Shm_SC !!"<< std::endl ;
+       #endif
+    }
+    else {
+
+         #ifdef DEBUG
+         std::cout << "RingBuffer::Receive(...) --> BEGIN Algorithm : Count_CS 
= " << _Tab_CS[0] << " | Write_CS = " << _Tab_CS[1] << "| Read_CS = " << 
_Tab_CS[2] << std::endl ;
+         #endif
+
+        if ( (_Tab_CS[1] > _Tab_CS[2]) || ((_Tab_CS[2] >= _Tab_CS[1]) && (Size 
+ _Tab_CS[2] <= _Size)) ) {
+       //  Plecture >= Pecriture || Pecriture >= Plecture && Taille a ecrire + 
Pecriture <=TailleTotaleSegment
+
+            #ifdef DEBUG
+            std::cout << "RingBuffer::Receive(...) --> Utilisation memcpy 
Simple " << std::endl ;
+            std::cout << "RingBuffer::Receive(...) --> Adresse Utilisee  
_Shm_CS->GetShm() = " <<  _Shm_CS->GetShm() << "| _Shm_CS->GetShm() + 
_Tab_CS[2] = " << (void *)((char *)(_Shm_CS->GetShm())+ (sizeof(void *) * 
_Tab_CS[2])) << std::endl ;
+            #endif
+
+            memcpy(Buffer, (void *)((char *)(_Shm_CS->GetShm())+ (sizeof(void 
*) * _Tab_CS[2])) ,Size) ;
+
+            _Tab_CS[0] += Size ;
+            _Tab_CS[2] += Size ;
+            }
+       else {
+
+            #ifdef DEBUG
+            std::cout << "RingBuffer::Receive(...) --> Utilisation memcpy 
Double " << std::endl ;
+            #endif
+
+            int Rest_byte_in_SHM =  _Size - _Tab_CS[2] ;
+
+            memcpy( Buffer, (void *)((char *)(_Shm_CS->GetShm())+ (sizeof(void 
*) * _Tab_CS[2])), Rest_byte_in_SHM ) ;
+
+            memcpy( (void *)((char *)(Buffer) + (sizeof(void *) * 
Rest_byte_in_SHM)), _Shm_CS->GetShm(), Size - Rest_byte_in_SHM ) ;
+
+            _Tab_CS[2] = (_Tab_CS[2] + Size) % _Size ;
+            _Tab_CS[0] += Size ;
+           } // Fin du if ((_Tab_SC[2] >= _Tab_SC[1]) ...) /else
+
+        #ifdef DEBUG
+        std::cout << "RingBuffer::Receive(...) --> END Algorithm : Count_CS = 
" << _Tab_CS[0] << " | Write_CS = " << _Tab_CS[1] << "| Read_CS = " << 
_Tab_CS[2] << std::endl ;
+        std::cout << "AVANT  memcpy(_Pw_Pr_CS->GetShm(), _Tab_CS, 3 * 
sizeof(int) ) ; !! " << std::endl ;
+        #endif
+
+        memcpy(_Pw_Pr_CS->GetShm(), _Tab_CS, 3 * sizeof(int) ) ;
+
+        #ifdef DEBUG
+        std::cout << "APRES  memcpy(_Pw_Pr_CS->GetShm(), _Tab_CS, 3 * 
sizeof(int) ) ; !! " << std::endl ;
+        #endif
+
+        } // Fin du else for if (_Tab_SC[0] == _Size )
+
+     try {
+     _Sem_CS->V() ;
+     }
+     catch(certi::SemaphoreHandlingError& e)
+     {
+       std::cout << "RingBuffer::Receive() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+       throw (certi::MessageNotReceived("RingBuffer::Receive() failed.")) ;;
+     }
+     }
+else{
+    try {
+       _Sem_SC->P() ;
+    }
+    catch(certi::SemaphoreHandlingError& e)
+    {
+       std::cout << "RingBuffer::Receive() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+       throw (certi::MessageNotReceived("RingBuffer::Receive() failed.")) ;;
+    }
+
+    memcpy(_Tab_SC, _Pw_Pr_SC->GetShm(), 3 * sizeof(int) ) ;
+
+    if (_Tab_SC[0] == _Size ) { // Test si il y a assez de place disponible 
dans le buffer (Exeption à envoyer)
+       try {
+         _Sem_SC->V() ;
+       }
+       catch(certi::SemaphoreHandlingError& e)
+       {
+          std::cout << "RingBuffer::Receive() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+          throw (certi::MessageNotReceived("RingBuffer::Receive() failed.")) ;
+       }
+       throw(certi::BufferEmpty("RingBuffer::Receive() failed.")) ;
+
+         #ifdef DEBUG
+         std::cout << "RingBuffer::Receive(...) --> Nothing to Read on _Shm_CS 
!!"<< std::endl ;
+         #endif
+
+         }
+    else {
+
+         #ifdef DEBUG
+         std::cout << "RingBuffer::Receive(...) --> Adresse _Tab_SC = " << 
_Tab_SC << " Adresse _Pw_Pr_SC = " << _Pw_Pr_SC << std::endl ;
+         std::cout << "RingBuffer::Receive(...) --> Begin of Algorithm : 
Count_SC = " << _Tab_SC[0] << " | Write_SC = " << _Tab_SC[1] << "| Read_SC = " 
<< _Tab_SC[2] << std::endl ;
+         #endif
+
+        if ( (_Tab_SC[1] > _Tab_SC[2]) || ((_Tab_SC[2] >= _Tab_SC[1]) && (Size 
+ _Tab_SC[2] <= _Size)) ) {
+        //  Plecture >= Pecriture || Pecriture >= Plecture && Taille a ecrire 
+ Pecriture <=TailleTotaleSegment
+
+            #ifdef DEBUG
+            std::cout << "RingBuffer::Receive(...) --> Utilisation memcpy 
Simple " << std::endl ;
+            std::cout << "RingBuffer::Receive(...) --> Adresse Utilisee  
_Shm_SC->GetShm() = " <<  _Shm_SC->GetShm() << "| _Shm_SC->GetShm() + 
_Tab_SC[2] = " << (void *)((char *)(_Shm_SC->GetShm())+ (sizeof(void *) * 
_Tab_SC[2])) << std::endl ;
+            #endif
+
+            memcpy( Buffer, (void *)((char *)(_Shm_SC->GetShm())+ (sizeof(void 
*) * _Tab_SC[2])) , Size) ;
+
+            _Tab_SC[0] += Size ;
+            _Tab_SC[2] += Size ;
+            }
+       else {
+
+            #ifdef DEBUG
+            std::cout << "RingBuffer::Receive(...) --> Utilisation memcpy 
Double " << std::endl ;
+            #endif
+
+            int Rest_byte_in_SHM =  _Size - _Tab_SC[2] ;
+
+            memcpy(Buffer, (void *)((char *)(_Shm_SC->GetShm())+ (sizeof(void 
*) * _Tab_SC[2])), Rest_byte_in_SHM ) ;
+
+            memcpy((void *)((char *)(Buffer) + (sizeof(void *) * 
Rest_byte_in_SHM)), _Shm_SC->GetShm(), Size - Rest_byte_in_SHM ) ;
+
+            _Tab_SC[2] = (_Tab_SC[2] + Size) % _Size ;
+            _Tab_SC[0] += Size ;
+            }
+
+         #ifdef DEBUG
+         std::cout << "RingBuffer::Receive(...) --> End of Algorithm : 
Count_SC = " << _Tab_SC[0] << " | Write_SC = " << _Tab_SC[1] << "| Read_SC = " 
<< _Tab_SC[2] << std::endl ;
+         #endif
+
+         memcpy(_Pw_Pr_SC->GetShm(), _Tab_SC, 3 * sizeof(int) ) ;
+
+         }  // Fin du else for if (_Tab_CS[0] == _Size )
+     try {
+        _Sem_SC->V() ;
+     }
+     catch(certi::SemaphoreHandlingError& e)
+     {
+       std::cout << "RingBuffer::Receive() Exception. " <<  "Name is : " << 
e._name << " Reason is : " << e._reason << std::endl ;
+       throw (certi::MessageNotReceived("RingBuffer::Receive() failed.")) ;;
+     }
+     }
+
+#ifdef DEBUG
+std::cout << "RingBuffer --> Receive complete!!!" << std::endl ;
+#endif
+
+} // End of RingBuffer::Receive(...)
+
+// ************************************************
+// Method : RingBuffer::Close()
+// ************************************************
+void RingBuffer::Close()
+                throw (certi::RingBufferNotClosed) {
+try {
+   _Shm_SC->Close() ;
+}
+catch(certi::SharedMemoryNotClosed& e)
+{
+    std::cout << "RingBuffer::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::RingBufferNotClosed("RingBuffer::Close() failed.")) ;;
+}
+catch(certi::HandleNotClosed& e)
+{
+    std::cout << "RingBuffer::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::RingBufferNotClosed("RingBuffer::Close() failed.")) ;;
+}
+try {
+   _Shm_CS->Close() ;
+}
+catch(certi::SharedMemoryNotClosed& e)
+{
+    std::cout << "RingBuffer::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::RingBufferNotClosed("RingBuffer::Close() failed.")) ;;
+}
+catch(certi::HandleNotClosed& e)
+{
+    std::cout << "RingBuffer::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::RingBufferNotClosed("RingBuffer::Close() failed.")) ;;
+}
+try {
+   _Pw_Pr_SC->Close() ;
+}
+catch(certi::SharedMemoryNotClosed& e)
+{
+    std::cout << "RingBuffer::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::RingBufferNotClosed("RingBuffer::Close() failed.")) ;;
+}
+catch(certi::HandleNotClosed& e)
+{
+    std::cout << "RingBuffer::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::RingBufferNotClosed("RingBuffer::Close() failed.")) ;;
+}
+try {
+   _Pw_Pr_CS->Close() ;
+}
+catch(certi::SharedMemoryNotClosed& e)
+{
+    std::cout << "RingBuffer::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::RingBufferNotClosed("RingBuffer::Close() failed.")) ;;
+}
+catch(certi::HandleNotClosed& e)
+{
+    std::cout << "RingBuffer::Close() Exception. " <<  "Name is : " << e._name 
<< " Reason is : " << e._reason << std::endl ;
+    throw (certi::RingBufferNotClosed("RingBuffer::Close() failed.")) ;;
+}
+
+} // End of RingBuffer::Close()
+

Index: libCERTI/SemaphoreWin32.cc
===================================================================
RCS file: libCERTI/SemaphoreWin32.cc
diff -N libCERTI/SemaphoreWin32.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SemaphoreWin32.cc  16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,142 @@
+#include "SemaphoreWin32.hh"
+
+// ************************************************
+// Constructor
+// ************************************************
+SemaphoreWin32::SemaphoreWin32(){
+_hSemaphore = NULL ;
+}
+
+// ************************************************
+// Destructor
+// ************************************************
+SemaphoreWin32::~SemaphoreWin32() {}
+
+// ************************************************
+// Method : SemaphoreWin32::Create_Init(...)
+// ************************************************
+void SemaphoreWin32::Create_Init(const int initval, const std::string& 
New_Semname)
+                                 throw(certi::SemaphoreNotCreated) {
+
+_hSemaphore = CreateSemaphore(
+                      (LPSECURITY_ATTRIBUTES)NULL,             // security 
attributes
+                      (LONG)(initval),                         // initial count
+                      (LONG)(1),                               // maximum count
+                      (LPCTSTR)(New_Semname.c_str()));         // named 
semaphore
+
+ if (_hSemaphore == NULL){
+      throw(certi::SemaphoreNotCreated("CreateSemaphore() failed.")) ;
+ }
+ #ifdef DEBUG
+ std::cout << "We create the semaphore identified by handle : " << _hSemaphore 
<< " and name : " << New_Semname << std::endl ;
+ #endif
+
+} // End of method : Create_Init(...)
+
+// ************************************************
+// Method : SemaphoreWin32::Attach(...)
+// ************************************************
+void SemaphoreWin32::Attach(const std::string& New_Semname)
+                            throw(certi::SemaphoreNotOpen){
+
+// Open the semaphore
+
+   _hSemaphore = OpenSemaphore(
+                      SEMAPHORE_ALL_ACCESS,             // security attributes
+                      FALSE,                            // Inherit Handle
+                      (LPCTSTR)(New_Semname.c_str()));                        
// named semaphore
+
+#ifdef DEBUG
+  std::cout << "We try to attach the semaphore identified by handle : " << 
_hSemaphore << " and name : " << New_Semname << std::endl ;
+#endif
+
+   if (_hSemaphore == NULL)
+   {
+        throw(certi::SemaphoreNotOpen("OpenSemaphore() failed.")) ;
+   }
+
+} // End of method : Attach(...)
+
+// ************************************************
+// Method : SemaphoreWin32::P
+// ************************************************
+
+void SemaphoreWin32::P()
+                    throw(certi::SemaphoreHandlingError) {
+
+#ifdef DEBUG
+std::cout << "Begin of Operation P for the semaphore identified by handle : " 
<< _hSemaphore << std::endl ;
+#endif
+
+DWORD  WINAPI dwRetCode;
+
+dwRetCode = WaitForSingleObject(
+                   (HANDLE)_hSemaphore,  // handle to semaphore
+                   INFINITE);    // if we want to have P blocked
+
+switch (dwRetCode)
+      {
+    // The semaphore object was signaled.
+          case WAIT_OBJECT_0:
+    // Semaphore is signaled
+    // go ahead and continue the work
+             break;
+
+          default:
+             // Handle errors
+             throw(certi::SemaphoreHandlingError("WaitForSingleObject() 
failed.")) ;
+      }
+
+#ifdef DEBUG
+std::cout << "End of Operation P for the semaphore identified by handle : " << 
_hSemaphore << std::endl  ;
+#endif
+
+} // End of P()
+
+
+// ************************************************
+// Method : SemaphoreWin32::V
+// ************************************************
+
+void SemaphoreWin32::V()
+                    throw(certi::SemaphoreHandlingError) {
+
+#ifdef DEBUG
+std::cout << "Begin of Operation V for the semaphore identified by handle : " 
<< _hSemaphore << std::endl ;
+#endif
+
+BOOL WINAPI retcode ;
+
+  retcode = ReleaseSemaphore(
+        _hSemaphore,  // handle to semaphore
+        1,            // increase count by one
+        NULL) ;       // not interested in previous count
+
+  if (retcode == 0) {
+      throw(certi::SemaphoreHandlingError("ReleaseSemaphore() failed.")) ;
+    }
+
+#ifdef DEBUG
+std::cout << "End of Operation V for the semaphore identified by handle : " << 
_hSemaphore << std::endl  ;
+#endif
+
+} // End of V()
+
+// ************************************************
+// Method : SemaphoreWin32::Delete
+// ************************************************
+void SemaphoreWin32::Delete()
+                    throw(certi::HandleNotClosed) {
+
+BOOL WINAPI retcode ;
+
+#ifdef DEBUG
+std::cout << "Destroy the semaphore identified by handle : " << _hSemaphore << 
std::endl ;
+#endif
+
+retcode = CloseHandle(_hSemaphore);
+
+if(retcode == 0)
+   throw(certi::HandleNotClosed("CloseHandle() failed.")) ;
+} // End of Delete()
+

Index: libCERTI/SHM.hh
===================================================================
RCS file: libCERTI/SHM.hh
diff -N libCERTI/SHM.hh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ libCERTI/SHM.hh     16 Jan 2010 20:17:14 -0000      3.1
@@ -0,0 +1,56 @@
+#ifndef SHM_H
+#define SHM_H
+
+#include <string>
+#include "certi.hh"
+
+/**
+ * A Shared Memory class.
+ * This class is an abstract base for representing a shared memory
+ * segment. A shared memory segment is identified by its name and
+ * has a size and a creator process.
+ */
+class CERTI_EXPORT SHM {
+protected :
+       std::string _Name ;
+       int  _Size ;
+       bool _IsCreator ;
+       void *_Shm ;
+
+public :
+       /**
+        * Constructor.
+        * @param[in] SHNName, the name of the shared memory segment.
+        *            this should be unique on a specified host.
+        * @param[in] SHMSize, the requested size of the SHM
+        */
+       SHM(const std::string& SHMName, const int SHMSize, const bool True)
+               {_Name=SHMName;
+                _Size=SHMSize;
+                _IsCreator=True;
+                }
+       SHM(const std::string& SHMName, const int SHMSize)
+               {_Name=SHMName;
+                _Size=SHMSize;
+                _IsCreator=false;
+                }
+       virtual ~SHM() {};
+       const std::string getName() const {return _Name ; } ;
+       inline void* GetShm(){return _Shm ; } ;
+       inline bool IsCreator(){return _IsCreator ; } ;
+       inline int GetSize(){return _Size ; } ;
+       virtual void Open() = 0 ;
+       virtual void Attach() = 0 ;
+       virtual void Close() = 0 ;
+
+        /**
+        * Build a proper SHM name from a user provided name.
+        * Idea kindly borrowed from TSP (https://savannah.nongnu.org)
+        * bb_utils_build_shm_name
+        */
+       static std::string buildShmName(const std::string& ShmName) {
+         return "/"+ShmName+"_shm";
+       }
+} ;
+
+#endif




reply via email to

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