Changeset 216 in pacpusframework


Ignore:
Timestamp:
11/08/13 12:20:22 (11 years ago)
Author:
Marek Kurdej
Message:

Modified: NewComponent: using pimpl to separate interface from implementation.

Location:
trunk/src/_NewComponent
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/_NewComponent/CMakeLists.txt

    r147 r216  
    3737
    3838# configure files
    39 configure_file(CMakeLists.txt.in   "${OUTPUT_DIR}/CMakeLists.txt" @ONLY)
    40 configure_file(NewComponent.cpp.in "${OUTPUT_DIR}/${PACPUS_COMPONENT_NAME}.cpp" @ONLY)
    41 configure_file(NewComponent.h.in "${OUTPUT_DIR}/${PACPUS_COMPONENT_NAME}.h" @ONLY)
     39configure_file("CMakeLists.txt.in" "${OUTPUT_DIR}/CMakeLists.txt" @ONLY)
     40configure_file("NewComponent.h.in" "${OUTPUT_DIR}/${PACPUS_COMPONENT_NAME}.h" @ONLY)
     41configure_file("NewComponent.cpp.in" "${OUTPUT_DIR}/${PACPUS_COMPONENT_NAME}.cpp" @ONLY)
     42configure_file("NewComponentImpl.h.in" "${OUTPUT_DIR}/${PACPUS_COMPONENT_NAME}Impl.h" @ONLY)
     43configure_file("NewComponentImpl.cpp.in" "${OUTPUT_DIR}/${PACPUS_COMPONENT_NAME}Impl.cpp" @ONLY)
    4244
    4345################################################################################
  • trunk/src/_NewComponent/CMakeLists.txt.in

    r194 r216  
    2727    ${EXPORT_HDR}
    2828    @PACPUS_COMPONENT_NAME@.h
     29    @PACPUS_COMPONENT_NAME@Impl.h
    2930)
    3031
     
    3233    ${PLUGIN_CPP}
    3334    @PACPUS_COMPONENT_NAME@.cpp
     35    @PACPUS_COMPONENT_NAME@Impl.cpp
    3436)
    3537
     
    3739    ${PLUGIN_HDR}
    3840    @PACPUS_COMPONENT_NAME@.h
     41    @PACPUS_COMPONENT_NAME@Impl.h
    3942)
    4043
     
    7780# INSTALL
    7881pacpus_install(${PROJECT_NAME})
     82
  • trunk/src/_NewComponent/NewComponent.cpp.in

    r194 r216  
    55
    66#include "@PACPUS_COMPONENT_NAME@.h"
     7#include "@PACPUS_COMPONENT_NAME@Impl.h"
    78
    89#include <Pacpus/kernel/ComponentFactory.h>
     
    1213using namespace std;
    1314
    14 DECLARE_STATIC_LOGGER("pacpus.base.@PACPUS_COMPONENT_NAME@");
     15DECLARE_STATIC_LOGGER("pacpus.@PACPUS_COMPONENT_NAME@");
    1516
    1617/// Constructs a static component factory
    1718static ComponentFactory<@PACPUS_COMPONENT_NAME@> sFactory("@PACPUS_COMPONENT_NAME@");
    18 
    19 static const int kDefaultVerboseLevel = 1;
    2019
    2120//////////////////////////////////////////////////////////////////////////
     
    2524    LOG_TRACE("constructor(" << name << ")");
    2625   
    27     namespace po = boost::program_options;
    2826    //addParameters()
    29     //("parameter-name", po::value<ParameterType>(&mParameterVariable)->required(), "parameter description")
    30     //("parameter-name", po::value<ParameterType>(&mParameterVariable)->default_value(0), "parameter description")
     27    //("parameter-name", value<ParameterType>(&mImpl->mParameterVariable)->required(), "parameter description")
     28    //("parameter-name", value<ParameterType>(&mImpl->mParameterVariable)->default_value(0), "parameter description")
    3129    //;
    3230}
     
    5351void @PACPUS_COMPONENT_NAME@::startActivity()
    5452{
     53    mImpl->start();
    5554}
    5655
    5756void @PACPUS_COMPONENT_NAME@::stopActivity()
    5857{
     58    mImpl->stop();
    5959}
    6060
     
    6464    return ComponentBase::CONFIGURED_OK;
    6565}
     66
     67//////////////////////////////////////////////////////////////////////////
     68//void @PACPUS_COMPONENT_NAME@::processInput(InputType const& input)
     69//{
     70//    mImpl->processInput(input);
     71//}
  • trunk/src/_NewComponent/NewComponent.h.in

    r194 r216  
    2020#include <Pacpus/kernel/ComponentBase.h>
    2121
     22#include <boost/scoped_ptr.hpp>
    2223#include <QObject>
    2324
    24 namespace pacpus {
     25namespace pacpus
     26{
    2527
    2628class @PACPUS_COMPONENT_NAME_CAPS@_API @PACPUS_COMPONENT_NAME@
     
    4951   
    5052private:
    51     //void processInput(const InputType & input);
     53    //void processInput(InputType const& input);
    5254
    5355private:
     56    struct Impl;
     57    boost::scoped_ptr<Impl> mImpl;
    5458};
    5559
     
    5761
    5862#endif // @PACPUS_COMPONENT_NAME_CAPS@_H
    59 
Note: See TracChangeset for help on using the changeset viewer.