From bcd027ca4d1df91fc9aee1ded37d495e88096580 Mon Sep 17 00:00:00 2001
From: Joris Goosen <Joris Goosen@ad.enterprisedynamics.com>
Date: Wed, 18 Nov 2015 11:12:04 +0100
Subject: [PATCH] Fix for MSVC 14 (VS 2015) -- Compiler complains about
 functions like (std::ostream& NM_FOM_Dimension::show(std::ostream& out)) when
 they are the right-hand value for an << operator. It also seems superfluous
 to do this in all cases the ostream in which was "written" by show was the
 same as the parameter "out".

Error: binary '<<': no operator found which takes a left-hand operand of type 'std::ostream' (or there is no acceptable conversion)	LibCERTI	C:\Users\Joris Goosen\Documents\CERTI Enzo\CERTI-3_5_1\libCERTI\NM_Classes.cc	96	Build
---
 libCERTI/M_Classes.cc  | 44 ++++++++++++++++++++++++++------------------
 libCERTI/M_Classes.hh  |  2 +-
 libCERTI/NM_Classes.cc | 16 ++++++++--------
 libCERTI/NM_Classes.hh |  2 +-
 4 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/libCERTI/M_Classes.cc b/libCERTI/M_Classes.cc
index 6df0bb1..8f9a6d8 100644
--- a/libCERTI/M_Classes.cc
+++ b/libCERTI/M_Classes.cc
@@ -47,12 +47,12 @@ namespace certi {
       SN = msgBuffer.read_uint64();
    }
 
-   std::ostream& EventRetraction::show(std::ostream& out) {
+   void EventRetraction::show(std::ostream& out) {
       out << "[EventRetraction -Begin]" << std::endl;      //Specific show code
       out << " sendingFederate = " << sendingFederate << " "       << std::endl;
       out << " SN = " << SN << " "       << std::endl;
       out << "[EventRetraction -End]" << std::endl;
-      return out;
+      return;
    }
 
    M_Open_Connexion::M_Open_Connexion() {
@@ -1044,8 +1044,9 @@ namespace certi {
          out << "         //FIXME FIXME don't know how to serialize native field <values> of type <AttributeValue_t>";
       }
       out << std::endl;
-      out << "(opt) eventRetraction =" << eventRetraction.show(out)      << std::endl;
-      out << "[M_Update_Attribute_Values -End]" << std::endl;
+      out << "(opt) eventRetraction =";
+      eventRetraction.show(out);
+      out << std::endl << "[M_Update_Attribute_Values -End]" << std::endl;
       return out;
    }
 
@@ -1095,8 +1096,9 @@ namespace certi {
       out << " objectClass = " << objectClass << " "       << std::endl;
       out << " object = " << object << " "       << std::endl;
       out << " objectName = " << objectName << " "       << std::endl;
-      out << "(opt) eventRetraction =" << eventRetraction.show(out)      << std::endl;
-      out << "[M_Discover_Object_Instance -End]" << std::endl;
+      out << "(opt) eventRetraction =";
+      eventRetraction.show(out);
+      out << std::endl << "[M_Discover_Object_Instance -End]" << std::endl;
       return out;
    }
 
@@ -1178,8 +1180,9 @@ namespace certi {
          out << "         //FIXME FIXME don't know how to serialize native field <values> of type <AttributeValue_t>";
       }
       out << std::endl;
-      out << "(opt) eventRetraction =" << eventRetraction.show(out)      << std::endl;
-      out << "[M_Reflect_Attribute_Values -End]" << std::endl;
+      out << "(opt) eventRetraction ="; 
+      eventRetraction.show(out);
+      out << std::endl << "[M_Reflect_Attribute_Values -End]" << std::endl;
       return out;
    }
 
@@ -1261,8 +1264,9 @@ namespace certi {
       }
       out << std::endl;
       out << " region = " << region << " "       << std::endl;
-      out << "(opt) eventRetraction =" << eventRetraction.show(out)      << std::endl;
-      out << "[M_Send_Interaction -End]" << std::endl;
+      out << "(opt) eventRetraction =";
+      eventRetraction.show(out);
+      out << std::endl << "[M_Send_Interaction -End]" << std::endl;
       return out;
    }
 
@@ -1344,8 +1348,9 @@ namespace certi {
       }
       out << std::endl;
       out << " region = " << region << " "       << std::endl;
-      out << "(opt) eventRetraction =" << eventRetraction.show(out)      << std::endl;
-      out << "[M_Receive_Interaction -End]" << std::endl;
+      out << "(opt) eventRetraction =";
+      eventRetraction.show(out);
+      out << std::endl << "[M_Receive_Interaction -End]" << std::endl;
       return out;
    }
 
@@ -1395,8 +1400,9 @@ namespace certi {
       out << " objectClass = " << objectClass << " "       << std::endl;
       out << " object = " << object << " "       << std::endl;
       out << " objectName = " << objectName << " "       << std::endl;
-      out << "(opt) eventRetraction =" << eventRetraction.show(out)      << std::endl;
-      out << "[M_Delete_Object_Instance -End]" << std::endl;
+      out << "(opt) eventRetraction =";
+      eventRetraction.show(out);
+      out << std::endl << "[M_Delete_Object_Instance -End]" << std::endl;
       return out;
    }
 
@@ -1478,8 +1484,9 @@ namespace certi {
       out << " objectClass = " << objectClass << " "       << std::endl;
       out << " object = " << object << " "       << std::endl;
       out << " objectName = " << objectName << " "       << std::endl;
-      out << "(opt) eventRetraction =" << eventRetraction.show(out)      << std::endl;
-      out << "[M_Remove_Object_Instance -End]" << std::endl;
+      out << "(opt) eventRetraction =";
+      eventRetraction.show(out);
+      out << std::endl << "[M_Remove_Object_Instance -End]" << std::endl;
       return out;
    }
 
@@ -3046,8 +3053,9 @@ namespace certi {
       out << "[M_Retract -Begin]" << std::endl;      //Call mother class
       Super::show(out);
       //Specific show code
-      out << " eventRetraction = " << eventRetraction.show(out)      << std::endl;
-      out << "[M_Retract -End]" << std::endl;
+      out << " eventRetraction = ";
+      eventRetraction.show(out);
+      out << std::endl << "[M_Retract -End]" << std::endl;
       return out;
    }
 
diff --git a/libCERTI/M_Classes.hh b/libCERTI/M_Classes.hh
index 3078e5b..35ed571 100644
--- a/libCERTI/M_Classes.hh
+++ b/libCERTI/M_Classes.hh
@@ -71,7 +71,7 @@ namespace certi {
          const uint64_t& getSN() const {return SN;}
          void setSN(const uint64_t& newSN) {SN=newSN;}
          // the show method
-         std::ostream& show(std::ostream& out);
+         void show(std::ostream& out);
       protected:
          FederateHandle sendingFederate;
          uint64_t SN;
diff --git a/libCERTI/NM_Classes.cc b/libCERTI/NM_Classes.cc
index 6b3383f..469b779 100644
--- a/libCERTI/NM_Classes.cc
+++ b/libCERTI/NM_Classes.cc
@@ -92,7 +92,7 @@ namespace certi {
       out << " name = " << name << " "       << std::endl;
       out << "    dimensions [] =" << std::endl;
       for (uint32_t i = 0; i < getDimensionsSize(); ++i) {
-         out << dimensions[i].show(out);
+         dimensions[i].show(out);
       }
       out << std::endl;
       out << "[NM_FOM_Routing_Space -End]" << std::endl;
@@ -180,7 +180,7 @@ namespace certi {
       out << " name = " << name << " "       << std::endl;
       out << "    attributes [] =" << std::endl;
       for (uint32_t i = 0; i < getAttributesSize(); ++i) {
-         out << attributes[i].show(out);
+         attributes[i].show(out);
       }
       out << std::endl;
       out << "[NM_FOM_Object_Class -End]" << std::endl;
@@ -258,7 +258,7 @@ namespace certi {
       }
    }
 
-   std::ostream& NM_FOM_Interaction_Class::show(std::ostream& out) {
+   void NM_FOM_Interaction_Class::show(std::ostream& out) {
       out << "[NM_FOM_Interaction_Class -Begin]" << std::endl;      //Specific show code
       out << " interactionClass = " << interactionClass << " "       << std::endl;
       out << " name = " << name << " "       << std::endl;
@@ -268,11 +268,11 @@ namespace certi {
       out << " transport = " << transport << " "       << std::endl;
       out << "    parameters [] =" << std::endl;
       for (uint32_t i = 0; i < getParametersSize(); ++i) {
-         out << parameters[i].show(out);
+         parameters[i].show(out);
       }
       out << std::endl;
       out << "[NM_FOM_Interaction_Class -End]" << std::endl;
-      return out;
+      return;
    }
 
    NM_Close_Connexion::NM_Close_Connexion() {
@@ -442,17 +442,17 @@ namespace certi {
       out << " federateName = " << federateName << " "       << std::endl;
       out << "    routingSpaces [] =" << std::endl;
       for (uint32_t i = 0; i < getRoutingSpacesSize(); ++i) {
-         out << routingSpaces[i].show(out);
+         routingSpaces[i].show(out);
       }
       out << std::endl;
       out << "    objectClasses [] =" << std::endl;
       for (uint32_t i = 0; i < getObjectClassesSize(); ++i) {
-         out << objectClasses[i].show(out);
+         objectClasses[i].show(out);
       }
       out << std::endl;
       out << "    interactionClasses [] =" << std::endl;
       for (uint32_t i = 0; i < getInteractionClassesSize(); ++i) {
-         out << interactionClasses[i].show(out);
+         interactionClasses[i].show(out);
       }
       out << std::endl;
       out << "[NM_Join_Federation_Execution -End]" << std::endl;
diff --git a/libCERTI/NM_Classes.hh b/libCERTI/NM_Classes.hh
index 8ef00a4..e5ea7d8 100644
--- a/libCERTI/NM_Classes.hh
+++ b/libCERTI/NM_Classes.hh
@@ -210,7 +210,7 @@ namespace certi {
          void setParameters(const NM_FOM_Parameter& newParameters, uint32_t rank) {parameters[rank]=newParameters;}
          void removeParameters(uint32_t rank) {parameters.erase(parameters.begin() + rank);}
          // the show method
-         std::ostream& show(std::ostream& out);
+         void show(std::ostream& out);
       protected:
          InteractionClassHandle interactionClass;
          std::string name;
-- 
2.6.3.windows.1

