diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2011-04-04 01:04:40 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2011-04-04 01:04:40 +0000 |
commit | 0a44f8606a3631dbb1715c26d5216806ab548cbd (patch) | |
tree | fb6e7f2cd95ba0771c409528d5d82860dccda201 | |
parent | 44e594dfa9c3ebfbbb0d03b4845f620031d47920 (diff) | |
download | ATCD-0a44f8606a3631dbb1715c26d5216806ab548cbd.tar.gz |
Mon Apr 4 01:03:22 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu>
* tools/Logger_Backend/ndds/Log_Backend.cpp:
* tools/Logger_Backend/ndds/Log_Record.idl:
* tools/Logger_Backend/ndds/Log_Server.cpp:
Warnings.
-rw-r--r-- | DAnCE/ChangeLog | 10 | ||||
-rw-r--r-- | DAnCE/tools/Logger_Backend/ndds/Log_Backend.cpp | 20 | ||||
-rw-r--r-- | DAnCE/tools/Logger_Backend/ndds/Log_Record.idl | 4 | ||||
-rw-r--r-- | DAnCE/tools/Logger_Backend/ndds/Log_Server.cpp | 8 |
4 files changed, 35 insertions, 7 deletions
diff --git a/DAnCE/ChangeLog b/DAnCE/ChangeLog index c2e88a9dcb6..c64c4aaf7e9 100644 --- a/DAnCE/ChangeLog +++ b/DAnCE/ChangeLog @@ -1,7 +1,15 @@ +Mon Apr 4 01:03:22 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu> + + * tools/Logger_Backend/ndds/Log_Backend.cpp: + * tools/Logger_Backend/ndds/Log_Record.idl: + * tools/Logger_Backend/ndds/Log_Server.cpp: + + Warnings. + Fri Apr 1 15:19:41 UTC 2011 Phil Mesnier <mesnier_p@ociweb.com> * tools/Logger_Backend/ndds/Log_Backend.cpp: - + more fuzz. Thu Mar 31 22:27:54 UTC 2011 William R. Otte <wotte@dre.vanderbilt.edu> diff --git a/DAnCE/tools/Logger_Backend/ndds/Log_Backend.cpp b/DAnCE/tools/Logger_Backend/ndds/Log_Backend.cpp index 4f116a4393a..98bbc66e4fe 100644 --- a/DAnCE/tools/Logger_Backend/ndds/Log_Backend.cpp +++ b/DAnCE/tools/Logger_Backend/ndds/Log_Backend.cpp @@ -6,6 +6,8 @@ #include "ace/Log_Record.h" #include "ace/Get_Opt.h" +#include <iostream> + namespace DAnCE { NDDS_Log_Backend::NDDS_Log_Backend (void) @@ -26,6 +28,7 @@ namespace DAnCE int NDDS_Log_Backend::init (int argc, ACE_TCHAR **argv) { + std::cerr << "init\n"; ACE_Get_Opt opts (argc, argv, ACE_TEXT ("t:d:"), 1, 0, ACE_Get_Opt::RETURN_IN_ORDER); opts.long_option (ACE_TEXT ("topic"), 't', ACE_Get_Opt::ARG_REQUIRED); @@ -51,8 +54,8 @@ namespace DAnCE return -1; } - return 0; } + return 0; } int @@ -88,6 +91,8 @@ namespace DAnCE int NDDS_Log_Backend::configure_dds (void) { + std::cerr << "configuring dds\n"; + this->participant_ = DDSDomainParticipantFactory::get_instance ()-> create_participant (this->domain_, DDS_PARTICIPANT_QOS_DEFAULT, @@ -101,7 +106,8 @@ namespace DAnCE } DDS_ReturnCode_t retval; - + + std::cerr << "participant\n"; retval = Log_RecordTypeSupport::register_type (this->participant_, Log_RecordTypeSupport::get_type_name ()); @@ -111,6 +117,7 @@ namespace DAnCE (void) this->close (); return -1; } + std::cerr << "type\n"; this->topic_ = this->participant_->create_topic (this->topic_name_.c_str (), Log_RecordTypeSupport::get_type_name (), @@ -125,6 +132,8 @@ namespace DAnCE return -1; } + std::cerr << "topic\n"; + this->publisher_ = this->participant_->create_publisher (DDS_PUBLISHER_QOS_DEFAULT, 0, DDS_STATUS_MASK_NONE); @@ -135,6 +144,7 @@ namespace DAnCE this->close (); return -1; } + std::cerr << "publisher\n"; this->datawriter_ = this->publisher_->create_datawriter (this->topic_, DDS_DATAWRITER_QOS_DEFAULT, @@ -147,6 +157,7 @@ namespace DAnCE return -1; } + std::cerr << "datawriter\n"; log_record_writer_ = Log_RecordDataWriter::narrow (this->datawriter_); return 0; @@ -160,6 +171,7 @@ namespace DAnCE ACE_ERROR ((LM_ERROR, ACE_TEXT ("NDDS_Log_Backend::open - unable to get configuration\n"))); return -1; } + std::cerr << "got configuration\n"; if (this->configure_dds () != 0) { @@ -167,6 +179,8 @@ namespace DAnCE return -1; } + std::cerr << "configured dds\n"; + return 0; } @@ -179,6 +193,7 @@ namespace DAnCE int NDDS_Log_Backend::close (void) { + std::cerr << "closing\n"; if (this->participant_ != 0) { DDS_ReturnCode_t retval = @@ -209,6 +224,7 @@ namespace DAnCE ssize_t NDDS_Log_Backend::log (ACE_Log_Record &log_record) { + std::cerr << "logging\n"; Log_Record *instance (0); instance = Log_RecordTypeSupport::create_data_ex (DDS_BOOLEAN_FALSE); diff --git a/DAnCE/tools/Logger_Backend/ndds/Log_Record.idl b/DAnCE/tools/Logger_Backend/ndds/Log_Record.idl index 1297a4a2331..7fc63d01a3a 100644 --- a/DAnCE/tools/Logger_Backend/ndds/Log_Record.idl +++ b/DAnCE/tools/Logger_Backend/ndds/Log_Record.idl @@ -13,10 +13,10 @@ module DAnCE struct Log_Record { /// The name of the node this originates from, if available - string node; //@key + string node; /// The process ID of the node. - long pid; //@key + long pid; /// The log priority of the message unsigned long priority; diff --git a/DAnCE/tools/Logger_Backend/ndds/Log_Server.cpp b/DAnCE/tools/Logger_Backend/ndds/Log_Server.cpp index 12ac6852a3f..b24d1791374 100644 --- a/DAnCE/tools/Logger_Backend/ndds/Log_Server.cpp +++ b/DAnCE/tools/Logger_Backend/ndds/Log_Server.cpp @@ -10,6 +10,7 @@ #include "ace/Log_Msg.h" #include "ace/OS_main.h" #include "ace/Get_Opt.h" +#include "ace/OS_NS_unistd.h" #include "ndds/ndds_cpp.h" #include "Log_Record.h" #include "Log_RecordSupport.h" @@ -147,11 +148,15 @@ ACE_TMAIN (int argc, ACE_TCHAR **argv) if (result == DDS_RETCODE_NO_DATA) { + std::cerr << "No data\n"; + ACE_OS::sleep (1); // try again continue; } else { + std::cerr << "Got " << records.length () << " records\n"; + for (size_t i = 0; i < records.length (); ++i) { DDS_SampleInfo &info = recordInfos[i]; @@ -161,10 +166,9 @@ ACE_TMAIN (int argc, ACE_TCHAR **argv) std::cerr << records[i].node.in () << ':' << records[i].pid << " - " - << records[i].message.in () << std::cerr; + << records[i].message.in () << std::endl; } } - log_record_reader_->return_loan (records, recordInfos); } } |