StringIn.cpp
Go to the documentation of this file.
00001 // -*- C++ -*-
00012 #include "StringIn.h"
00013 #include <unistd.h>
00014 #include <iostream>
00015 #include <string>
00016 
00017 using namespace std;
00018 
00019 StringIn::StringIn(RtcManager* manager)
00020   : RtcBase(manager) ,
00021     m_string_inIn("string_in", m_string_in)
00022 
00023 {
00024   registerInPort(m_string_inIn);
00025   appendAlias("/example/StringIn|rtc");
00026 }
00027 
00028 /*
00029 RtmRes StringIn::rtc_init_entry()
00030 {
00031   return RTM_OK;
00032 }
00033 */
00034 
00035 
00036 
00037 /*
00038 RtmRes StringIn::rtc_ready_entry()
00039 {
00040   return RTM_OK;
00041 }
00042 */
00043 
00044 
00045 
00046 /*
00047 RtmRes StringIn::rtc_ready_do()
00048 {
00049   return RTM_OK;
00050 }
00051 */
00052 
00053 
00054 
00055 /*
00056 RtmRes StringIn::rtc_ready_exit()
00057 {
00058   return RTM_OK;
00059 }
00060 */
00061 
00062 
00063 
00064 /*
00065 RtmRes StringIn::rtc_starting_entry()
00066 {
00067   return RTM_OK;
00068 }
00069 */
00070 
00071 
00072 
00073 /*
00074 RtmRes StringIn::rtc_active_entry()
00075 {
00076   return RTM_OK;
00077 }
00078 */
00079 
00080 
00081 
00082 
00083 RtmRes StringIn::rtc_active_do()
00084 {
00085   while (!m_string_inIn.isNew()) coil::usleep(100000);
00086   m_string_inIn.read();
00087   std::cout << m_string_in.data << std::endl;
00088   return RTM_OK;
00089 }
00090 
00091 
00092 
00093 
00094 /*
00095 RtmRes StringIn::rtc_active_exit()
00096 {
00097   return RTM_OK;
00098 }
00099 */
00100 
00101 
00102 
00103 /*
00104 RtmRes StringIn::rtc_stopping_entry()
00105 {
00106   return RTM_OK;
00107 }
00108 */
00109 
00110 
00111 
00112 /*
00113 RtmRes StringIn::rtc_aborting_entry()
00114 {
00115   return RTM_OK;
00116 }
00117 */
00118 
00119 
00120 
00121 /*
00122 RtmRes StringIn::rtc_error_entry()
00123 {
00124   return RTM_OK;
00125 }
00126 */
00127 
00128 
00129 
00130 /*
00131 RtmRes StringIn::rtc_error_do()
00132 {
00133   return RTM_OK;
00134 }
00135 */
00136 
00137 
00138 
00139 /*
00140 RtmRes StringIn::rtc_error_exit()
00141 {
00142   return RTM_OK;
00143 }
00144 */
00145 
00146 
00147 
00148 /*
00149 RtmRes StringIn::rtc_fatal_entry()
00150 {
00151   return RTM_OK;
00152 }
00153 */
00154 
00155 
00156 
00157 /*
00158 RtmRes StringIn::rtc_fatal_do()
00159 {
00160   return RTM_OK;
00161 }
00162 */
00163 
00164 
00165 
00166 /*
00167 RtmRes StringIn::rtc_fatal_exit()
00168 {
00169   return RTM_OK;
00170 }
00171 */
00172 
00173 
00174 
00175 /*
00176 RtmRes StringIn::rtc_exiting_entry()
00177 {
00178   return RTM_OK;
00179 }
00180 */
00181 
00182 
00183 
00184 extern "C" {
00185   
00186   RtcBase* StringInNew(RtcManager* manager)
00187   {
00188         return new StringIn(manager);
00189   }
00190   
00191   
00192   void StringInDelete(RtcBase* p)
00193   {
00194         delete (StringIn *)p;
00195         return;
00196   }
00197   
00198   
00199   void StringInInit(RtcManager* manager)
00200   {
00201         RtcModuleProfile profile(stringin_spec);
00202         manager->registerComponent(profile, StringInNew, StringInDelete);
00203   }
00204 };
00205 


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Sat Jun 8 2019 18:49:07