text: // -*- C++ -*-
  /*!
   * @file  SignalGeneration.h
   * @author Isao Hara(isao-hara@aist.go.jp)
   *
   * Copyright (C) 
   *     All rights reserved.
   *
   */
  
  #ifndef _SignalGeneration_H_
  #define _SignalGeneration_H_
  
  #include <iostream>
  #include <string>
  #include <stdlib.h>
  #include <stdio.h>
  #include <list>
  #include <math.h>
  
  /*
   insert include files for 3rd party libs
  */
  
  /*
    Data Types
  */
  #include <rtm/idl/BasicDataTypeSkel.h>
  #include <rtm/idl/ExtendedDataTypesSkel.h>
  #include <rtm/idl/InterfaceDataTypesSkel.h>
  
  /*
    for RTC
  */
  #include <rtm/Manager.h>
  #include <rtm/DataFlowComponentBase.h>
  #include <rtm/CorbaPort.h>
  #include <rtm/DataInPort.h>
  #include <rtm/DataOutPort.h>
  #include <rtm/SystemLogger.h>
  #include <coil/Mutex.h>
  
  // Service implementation headers
  // <rtc-template block="service_impl_h">
  
  // </rtc-template>
  
  // Service Consumer stub headers
  // <rtc-template block="consumer_stub_h">
  
  // </rtc-template>
  #ifndef M_PI
  #define M_PI 3.14159265358979
  #endif
  
  using namespace RTC;
  
  /*!
   * @class SignalGeneration
   * @brief Periodic Console Out Component
   *
   */
  class SignalGeneration
    : public RTC::DataFlowComponentBase
  {
   public:
    unsigned long m_totalframes;      //!< Max frames to buffer size
  
    /*!
     * @brief constructor
     * @param manager Maneger Object
     */
    SignalGeneration(RTC::Manager* manager);
  
    /*!
     * @brief destructor
     */
    ~SignalGeneration();
  
    // <rtc-template block="public_attribute">
  
    // </rtc-template>
  
    // <rtc-template block="public_operation">
  
    // </rtc-template>
  
     /**
       Actions
    */
     
     virtual RTC::ReturnCode_t onInitialize();
  
     virtual RTC::ReturnCode_t onFinalize();
  
     /* virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id); */
  
     /* virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id); */
  
     virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
  
     virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
  
     /* virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id); */
  
     /* virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id); */
  
     /* virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id); */
  
     virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
  
     /* virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id); */
  
     /* virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id); */
  
     /* virtual RTC::ReturnCode_t onAction(RTC::UniqueId ec_id); */
  
     /* virtual RTC::ReturnCode_t onModeChanged(RTC::UniqueId ec_id); */
  
  
  
   protected:
    // <rtc-template block="protected_attribute">
  
    // </rtc-template>
  
    // <rtc-template block="protected_operation">
  
    // </rtc-template>
  
    // DataPort declaration
    // <rtc-template block="dataport_declare">
  
    RTC::TimedOctetSeq m_AudioDataOut;
    OutPort<RTC::TimedOctetSeq> m_AudioDataOutOut;
  
  
  
    // </rtc-template>
  
    // CORBA Port declaration
    // <rtc-template block="corbaport_declare">
  
    // </rtc-template>
  
    // Service declaration
    // <rtc-template block="service_declare">
  
    // </rtc-template>
  
    // Consumer declaration
    // <rtc-template block="consumer_declare">
  
    // </rtc-template>
  
   private:
    coil::TimeValue m_timer;
    double m_pbuff;
    int m_cnt;
    bool m_flg;
  
    // <rtc-template block="private_attribute">
    coil::Mutex m_mutex;
    
    std::string m_Mode;
    int m_Frequency;
    int m_Gain;
    int m_OutputSampleRate;
  
  
    // </rtc-template>
  
    // <rtc-template block="private_operation">
  
    // </rtc-template>
  
  };
  
  
  
  extern "C"
  {
    /*!
     * @brief SignalGeneration initialize
     *
     * @param manager Maneger Object
     */
    DLL_EXPORT void SignalGenerationInit(RTC::Manager* manager);
  };
  
  
  #endif // _SignalGeneration_H_
  