UpdateProcessor_T.cpp

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #ifndef UPDATEPROCESSOR_T_CPP
00009 #define UPDATEPROCESSOR_T_CPP
00010 
00011 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00012 #pragma once
00013 #endif /* ACE_LACKS_PRAGMA_ONCE */
00014 
00015 #include "DcpsInfo_pch.h"
00016 #include "dds/DCPS/debug.h"
00017 #include "UpdateProcessor_T.h"
00018 
00019 namespace OpenDDS {
00020 namespace Federator {
00021 
00022 template<class DataType>
00023 UpdateProcessor<DataType>::UpdateProcessor()
00024 {
00025   if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00026     ACE_DEBUG((LM_DEBUG,
00027                ACE_TEXT("(%P|%t) UpdateProcessor::UpdateProcessor()\n")));
00028   }
00029 }
00030 
00031 template<class DataType>
00032 UpdateProcessor<DataType>::~UpdateProcessor()
00033 {
00034   if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00035     ACE_DEBUG((LM_DEBUG,
00036                ACE_TEXT("(%P|%t) UpdateProcessor::~UpdateProcessor()\n")));
00037   }
00038 }
00039 
00040 template<class DataType>
00041 void
00042 UpdateProcessor<DataType>::processSample(
00043   const DataType*          sample,
00044   const DDS::SampleInfo* info)
00045 {
00046   if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00047     ACE_DEBUG((LM_DEBUG,
00048                ACE_TEXT("(%P|%t) UpdateProcessor::processSample()\n")));
00049   }
00050 
00051   if (info->valid_data) {
00052     switch (sample->action) {
00053     case CreateEntity:
00054       this->processCreate(sample, info);
00055       break;
00056     case UpdateQosValue1:
00057       this->processUpdateQos1(sample, info);
00058       break;
00059     case UpdateQosValue2:
00060       this->processUpdateQos2(sample, info);
00061       break;
00062     case UpdateFilterExpressionParams:
00063       this->processUpdateFilterExpressionParams(sample, info);
00064       break;
00065     case DestroyEntity:
00066       this->processDelete(sample, info);
00067       break;
00068     default:
00069       ACE_ERROR((LM_ERROR,
00070                  ACE_TEXT("(%P|%t) ERROR: UpdateProcessor::processSample() - ")
00071                  ACE_TEXT("upsupported action type: %d.\n"),
00072                  sample->action));
00073       break;
00074     }
00075 
00076   } else {
00077     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00078       ACE_DEBUG((LM_DEBUG,
00079                  ACE_TEXT("(%P|%t) UpdateProcessor::processSample() - ")
00080                  ACE_TEXT("sample not valid, declining to process.\n")));
00081     }
00082   }
00083 }
00084 
00085 template<class DataType>
00086 void
00087 UpdateProcessor<DataType>::processUpdateQos2(
00088   const DataType*          /* sample */,
00089   const DDS::SampleInfo* /* info */)
00090 {
00091   /* This method intentionally left unimplemented. */
00092 }
00093 
00094 template<class DataType>
00095 void
00096 UpdateProcessor<DataType>::processUpdateFilterExpressionParams(
00097   const DataType*        /* sample */,
00098   const DDS::SampleInfo* /* info */)
00099 {
00100   /* This method intentionally left unimplemented. */
00101 }
00102 
00103 } // namespace Federator
00104 } // namespace OpenDDS
00105 
00106 #endif /* UPDATEPROCESSOR_T_CPP */

Generated on Fri Feb 12 20:05:29 2016 for OpenDDS by  doxygen 1.4.7