Add const qualifier to constructor port parameter 40/4240/1 1.1.0
authorE. Scott Daniels <daniels@research.att.com>
Fri, 26 Jun 2020 13:01:52 +0000 (09:01 -0400)
committerE. Scott Daniels <daniels@research.att.com>
Fri, 26 Jun 2020 13:01:52 +0000 (09:01 -0400)
The port parameter defined by constructors should have a
const qualifier in order to allow a static string to be
passed. This change adds that qualifier

Issue-ID: RIC-534

Signed-off-by: E. Scott Daniels <daniels@research.att.com>
Change-Id: Ib5a20825c3ff897cea31a3fbaac58b33dc7633f4

12 files changed:
CHANGES
CMakeLists.txt
doc/src/Makefile
doc/src/rtd/Makefile
doc/src/rtd/rel-notes.rst
doc/src/rtd/rel-notes.xfm
doc/src/rtd/setup.im
docs/rel-notes.rst
src/messaging/messenger.cpp
src/messaging/messenger.hpp
src/xapp/xapp.cpp
src/xapp/xapp.hpp

diff --git a/CHANGES b/CHANGES
index 3833dbd..74ab3b7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
 # This file contains a brief summary of each version bump.
 
+2020 June 26; version 1.1.0
+       Change the port type in constructors to indicate "const"
+
+       Version bump to 1.1.0 to allow patches to bronze code to 
+       continue to be done on the 1.0.* level.
+
 2020 April 28; version 1.0.0
        Bump version to force package build (old CI version added
        incorrect install prefix). Bump to 1.0.0 for release.
index 391070d..eaeef37 100644 (file)
@@ -29,7 +29,7 @@ project( ricxfcpp )
 cmake_minimum_required( VERSION 3.5 )
 
 set( major_version "1" )               # should be automatically populated from git tag later, but until CI process sets a tag we use this
-set( minor_version "0" )
+set( minor_version "1" )
 set( patch_level "0" )
 
 set( install_root "${CMAKE_INSTALL_PREFIX}" )
index f36ffd1..14e3320 100644 (file)
@@ -16,3 +16,4 @@
 
 publish:
        (cd user; make publish)
+       (cd rtd; make publish)
index 5a767df..eda0613 100644 (file)
@@ -37,7 +37,7 @@ desired_out = rst
 
 %.rst: %.xfm
        OUTPUT_TYPE=rst XFM_PASS=1 tfm $< /dev/null
-       GEN_TITLE=1 OUTPUT_TYPE=rst XFM_PASS=2 tfm $< | sed 's/^ //' >$@
+       GEN_TITLE=1 OUTPUT_TYPE=rst XFM_PASS=2 tfm $< | sed 's/ $$//; s/^ //' >$@
 
 %.txt: %.xfm
        OUTPUT_TYPE=txt XFM_PASS=1 tfm $< /dev/null
@@ -60,7 +60,7 @@ rel-notes.rst: rel-notes.xfm $(imbed_src)
 #
 $(docs:%=%.rst): always
 
-publish: user_guide.rst
+publish: rel-notes.rst
        cp *.rst ../../../docs/
 
 # intermeidate junk that might straggle
index d622981..7c5615b 100644 (file)
@@ -1,13 +1,31 @@
-============================================================================================ 
-Release Notes 
-============================================================================================ 
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+..
+.. CAUTION: this document is generated from source in doc/src/*
+.. To make changes edit the source and recompile the document.
+.. Do NOT make changes directly to .rst or .md files.
+
+
+============================================================================================
+Release Notes
+============================================================================================
 
 
 C++ Framework Release Notes
 ===========================
 
-The following is a list of release highlights for the C++ 
-xAPP Framework. 
+The following is a list of release highlights for the C++
+xAPP Framework.
+
+
+2020 June 26; version 1.1.0
+---------------------------
+
+Change the port type in constructors to indicate "const"
+
+Version bump to 1.1.0 to allow patches to bronze code to
+continue to be done on the 1.0.* level.
+
 
 
 Bronze Release
@@ -18,14 +36,14 @@ Bronze Release
 2020 April 28; version 1.0.0
 ----------------------------
 
-Bump version to force package build (old CI version added 
-incorrect install prefix). Bump to 1.0.0 for release. 
+Bump version to force package build (old CI version added
+incorrect install prefix). Bump to 1.0.0 for release.
+
 
 
 2020 March 27; version 0.1.2
 ----------------------------
 
-Changes identified by sonar (missing copy/move builders) 
-rmr_dump example programme Improvements to code for better 
-test coverage 
+Changes identified by sonar (missing copy/move builders)
+rmr_dump example programme Improvements to code for better
+test coverage
index bdc1521..8049fb6 100644 (file)
 &h1(C++ Framework Release Notes)
 The following is a list of release highlights for the C++ xAPP Framework.
 
+&h2(2020 June 26; version 1.1.0)
+       Change the port type in constructors to indicate "const"
+&space
+
+       Version bump to 1.1.0 to allow patches to bronze code to 
+       continue to be done on the 1.0.* level.
+&space
+
 &h1(Bronze Release)
 &h2(2020 April 28; version 1.0.0)
        Bump version to force package build (old CI version added
index b05e487..86f3be8 100644 (file)
@@ -28,6 +28,7 @@
 .fi
 
 .if  ! _setup_im
+.dv _setup_im 1
 
 .** allow environment LIB to override
 .gv e LIB lib
@@ -63,7 +64,7 @@
 .** if we can set a license into the output, do it early
 .cd 1 11i
 &line_len(10i)
-.im license.im
+.im &{lib}/license.im
 .cd 1 6.5i m=0 i=0
 &line_len( 6i)
 
 .fi
 
 .if doc_title
-       .im &{lib}/library/front_junk.im
-.fi
-
-.dv _setup_im 1
+       .im &{lib}/front_junk.im
 .fi
 
-.if "&ot" "rst" =
-    .** copyright into .rst because it supports internal comments
-    .im license.im
-
-    &many_equals .br
-    &doc_title
-    &many_equals .br
-    .if doc_subtitle
-        &many_dashes .br
-        &doc_subtitle .br
-        &many_dashes .br
-    .fi
-.ei
-    &center_start
-    &doc_title .br
-    .if doc_subtitle
-        &doc_subtitle .br
-    .fi
 .fi
 
index d622981..7c5615b 100644 (file)
@@ -1,13 +1,31 @@
-============================================================================================ 
-Release Notes 
-============================================================================================ 
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+..
+.. CAUTION: this document is generated from source in doc/src/*
+.. To make changes edit the source and recompile the document.
+.. Do NOT make changes directly to .rst or .md files.
+
+
+============================================================================================
+Release Notes
+============================================================================================
 
 
 C++ Framework Release Notes
 ===========================
 
-The following is a list of release highlights for the C++ 
-xAPP Framework. 
+The following is a list of release highlights for the C++
+xAPP Framework.
+
+
+2020 June 26; version 1.1.0
+---------------------------
+
+Change the port type in constructors to indicate "const"
+
+Version bump to 1.1.0 to allow patches to bronze code to
+continue to be done on the 1.0.* level.
+
 
 
 Bronze Release
@@ -18,14 +36,14 @@ Bronze Release
 2020 April 28; version 1.0.0
 ----------------------------
 
-Bump version to force package build (old CI version added 
-incorrect install prefix). Bump to 1.0.0 for release. 
+Bump version to force package build (old CI version added
+incorrect install prefix). Bump to 1.0.0 for release.
+
 
 
 2020 March 27; version 0.1.2
 ----------------------------
 
-Changes identified by sonar (missing copy/move builders) 
-rmr_dump example programme Improvements to code for better 
-test coverage 
+Changes identified by sonar (missing copy/move builders)
+rmr_dump example programme Improvements to code for better
+test coverage
index 24fe164..4e5a278 100644 (file)
@@ -60,13 +60,15 @@ const int Messenger::DEFAULT_CALLBACK = -1;
 
        If port is nil, then the default port is used (4560).
 */
-Messenger::Messenger( char* port, bool wait4table ) {
-       if( port == NULL ) {
-               port = (char *) "4560";
+Messenger::Messenger( const char* uport, bool wait4table ) {
+
+       if( uport == NULL ) {
+               listen_port = strdup( "4560" );
+       } else {
+               listen_port = strdup( uport );
        }
 
        gate = new std::mutex();
-       listen_port = strdup( port );
        mrc = rmr_init( listen_port, Messenger::MAX_PAYLOAD, 0 );
 
        if( wait4table ) {
@@ -79,9 +81,9 @@ Messenger::Messenger( char* port, bool wait4table ) {
 }
 
 /*
-       Move support. We DO allow the instance to be moved as only one copy 
+       Move support. We DO allow the instance to be moved as only one copy
        remains following the move.
-       Given a source object instance (soi) we move the information to 
+       Given a source object instance (soi) we move the information to
        the new object, and then DELETE what was moved so that when the
        user frees the soi, it doesn't destroy what we snarfed.
 */
@@ -91,7 +93,7 @@ Messenger::Messenger( Messenger&& soi ) {
        ok_2_run = soi.ok_2_run;
        gate = soi.gate;
                cb_hash = soi.cb_hash;                          // this seems dodgy
-       
+
        soi.gate = NULL;
        soi.listen_port = NULL;
        soi.mrc = NULL;
@@ -115,7 +117,7 @@ Messenger& Messenger::operator=( Messenger&& soi ) {
                ok_2_run = soi.ok_2_run;
                gate = soi.gate;
                        cb_hash = soi.cb_hash;                          // this seems dodgy
-               
+
                soi.gate = NULL;
                soi.listen_port = NULL;
                soi.mrc = NULL;
index 0810aeb..b6e46b6 100644 (file)
@@ -65,7 +65,7 @@ class Messenger {
                static const int MAX_PAYLOAD;                   // max message size we'll handle
                static const int DEFAULT_CALLBACK;              // parm for add callback to set default
 
-               Messenger( char* port, bool wait4table );       // builder
+               Messenger( const char* port, bool wait4table ); // builder
                Messenger( Messenger&& soi );                           // move construction
                Messenger& operator=( Messenger&& soi );        // move operator
                ~Messenger();                                                           // destroyer
index 8feb52e..cb14f2e 100644 (file)
@@ -54,7 +54,7 @@
 
        If port is nil, then the default port is used (4560).
 */
-Xapp::Xapp( char* port, bool wait4table ) : Messenger( port, wait4table ) {
+Xapp::Xapp( const char* port, bool wait4table ) : Messenger( port, wait4table ) {
        // nothing to do; all handled in Messenger constructor
 }
 
index 83540ec..5ba47ec 100644 (file)
@@ -52,7 +52,7 @@ class Xapp : public Messenger {
                Xapp& operator=( const Xapp& soi );
 
        public:
-               Xapp( char* listen_port, bool wait4rt );        // builder
+               Xapp( const char* listen_port, bool wait4rt );  // builder
                Xapp( );
                ~Xapp();                                                                        // destroyer