Commit 9e7fdc36 authored by Marco Bartolini's avatar Marco Bartolini
Browse files

improvements in ComponentProxy

parent 202f4812
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
#ifndef ANTENNABOSSPROXY_H
#define ANTENNABOSSPROXY_H

#include <AntennaBossC.h>

#include "ComponentProxy.h"

namespace Antenna
{
    PROXY_COMPONENT(AntennaBoss);
};

#endif
+10 −2
Original line number Diff line number Diff line
@@ -200,10 +200,14 @@ template <typename ComponentClass, typename ComponentVar>
void
ComponentProxy<ComponentClass, ComponentVar>::setComponentName(const char* name)
{
    if(name == "")
    if(m_name == "")
        m_name = std::string(name);
    else{
        //TODO: throw exception?
        CUSTOM_LOG(LM_FULL_INFO, 
                   "ComponentLoader::setComponentName",
                   (LM_DEBUG, ("ComponentName already defined: " + this->m_name).c_str())
                   );
    }
}

@@ -212,10 +216,14 @@ void
ComponentProxy<ComponentClass, ComponentVar>::setContainerServices(
    maci::ContainerServices* services)
{
    if(m_services != NULL)
    if(m_services == NULL)
        m_services = services;
    else{
        //TODO: throw exception?
        CUSTOM_LOG(LM_FULL_INFO, 
                   "ComponentLoader::setContainerServices",
                   (LM_DEBUG, "ContainerServices already defined")
                   );
    }
}

+0 −14
Original line number Diff line number Diff line
#ifndef COMPONENTPROXYDEFINITIONS_H
#define COMPONENTPROXYDEFINITIONS_H

#include <CustomLoggerC.h>

#include "ComponentProxy.h"

namespace Management
{
    PROXY_COMPONENT(CustomLogger);
};

#endif
+54 −5
Original line number Diff line number Diff line
@@ -10,16 +10,65 @@
# mbartolini  17/02/15  created
#

EXECUTABLES_L   = compilation_test
EXECUTABLES_L   = compilation_test single_component
compilation_test_OBJECTS    = compilation_test
compilation_test_LIBS       = IRALibrary ManagmentDefinitionsStubs AntennaDefinitionsStubs \
                              CustomLoggerStubs AntennaBossStubs \
                              ManagementErrors ComponentErrors AntennaErrors
compilation_test_LIBS       = IRALibrary \
                              ManagmentDefinitionsStubs \
                              AntennaDefinitionsStubs \
                              MinorServoDefinitionsStubs \
                              ReceiversDefinitionsStubs \
                              CommonReceiverInterfaceStubs \
                              GenericReceiverStubs \
                              DewarPositionerDefinitionsStubs \
                              BackendsDefinitionsStubs \
                              CustomLoggerStubs \
                              ExternalClientsStubs \
                              SchedulerStubs \
                              FitsWriterStubs \
                              CalibrationToolStubs \
                              AntennaBossStubs \
                              BackendsBossStubs \
                              DBBCStubs \
                              HolographyStubs \
                              NoiseGeneratorStubs \
                              TotalPowerStubs \
                              ActiveSurfaceBossStubs \
                              MinorServoBossStubs \
                              MinorServoStubs \
                              ReceiversBossStubs \
                              DewarPositionerStubs \
                              LocalOscillatorInterfaceStubs \
                              GenericWeatherStationStubs \
                              DataReceiverStubs \
                              GenericBackendStubs \
                              CommonReceiverInterfaceStubs \
                              bulkDataStubs bulkDataReceiverStubs \
                              bulkDataCallback bulkDataSenderStubs \
                              ManagementErrors \
                              ComponentErrors \
                              AntennaErrors \
                              MinorServoErrors \
                              ReceiversErrors \
                              BackendsErrors 

single_component_OBJECTS = single_component
single_component_LIBS = SchedulerStubs IRALibrary ManagmentDefinitionsStubs \
                        AntennaDefinitionsStubs \
                        ManagementErrors ComponentErrors

#
# Includes (.h) files (public only)
# ---------------------------------
INCLUDES        = ComponentProxy.h AntennaBossProxy.h CustomLoggerProxy.h
INCLUDES        = ActiveSurfaceProxy.h  \
                  BackendsProxy.h   \
                  ComponentProxy.h \
                  MinorServoProxy.h  \
                  WeatherProxy.h \
                  AntennaProxy.h \
                  ComponentProxies  \
                  ManagementProxy.h  \
                  ReceiversProxy.h


#
#>>>>> END OF standard rules
+17 −4
Original line number Diff line number Diff line
#include "CustomLoggerProxy.h"
#include "AntennaBossProxy.h"
#include "ComponentProxies"

/**
 * As this Library is composed by only an header file
@@ -11,9 +10,23 @@
int main()
{
    Management::CustomLogger_proxy m_customLogger;
    m_customLogger.setComponentName("CustomLogger");
    m_customLogger->emitLog("Proxy log!", Management::C_INFO);
    Management::ExternalClients_proxy m_externalClientsProxy;
    Management::Scheduler_proxy m_schedulerProxy;
    Management::FitsWriter_proxy m_fitsWriterProxy;
    Management::CalibrationTool_proxy m_calibrationToolProxy;
    Antenna::AntennaBoss_proxy m_antennaBoss;
    Backends::BackendsBoss_proxy m_backendBoss;
    Backends::DBBC_proxy m_dbbcProxy;
    Backends::Holography_proxy m_holographyProxy;
    Backends::NoiseGenerator_proxy m_noiseProxy;
    Backends::TotalPower_proxy m_totalPowerProxy;
    ActiveSurface::ActiveSurfaceBoss_proxy m_acitveSurfaceBossProxy;
    MinorServo::MinorServoBoss_proxy m_minorservoBossProxy;
    MinorServo::WPServo_proxy m_wpServoProxy;
    Receivers::ReceiversBoss_proxy m_receiversBossProxy;
    Receivers::DewarPositioner_proxy m_dewarPositionerProxy;
    Receivers::LocalOscillator_proxy m_localOscillatorProxy;
    Weather::GenericWeatherStation_proxy m_genericWeatherStationProxy;
    return 0;
}