Sha256: 4315e8198ea2314c882829e267c2e311f1e47537983d5dff8989e75d3a7d0651

Contents?: true

Size: 1.79 KB

Versions: 17

Compression:

Stored size: 1.79 KB

Contents

#include "../../../shared/generated/cpp/EventsourceBase.h"

namespace rho {

using namespace apiGenerator;

class CEventsourceImpl: public CEventsourceBase
{
public:
    CEventsourceImpl(const rho::String& strID): CEventsourceBase()
    {
    }

    virtual void getPlatformName(rho::apiGenerator::CMethodResult& oResult) {
         oResult.set("WM");
    }

    virtual void calcSumm( int a,  int b, rho::apiGenerator::CMethodResult& oResult) {
         oResult.set(a+b);
    }
    
    virtual void joinStrings( const rho::String& a,  const rho::String& b, rho::apiGenerator::CMethodResult& oResult) {
         oResult.set(a+b);
    }

};

class CEventsourceSingleton: public CEventsourceSingletonBase
{
    ~CEventsourceSingleton(){}
    virtual rho::String getInitialDefaultID();
    virtual void enumerate(CMethodResult& oResult);
};

class CEventsourceFactory: public CEventsourceFactoryBase
{
    ~CEventsourceFactory(){}
    virtual IEventsourceSingleton* createModuleSingleton();
    virtual IEventsource* createModuleByID(const rho::String& strID);
};

extern "C" void Init_Eventsource_extension()
{
    CEventsourceFactory::setInstance( new CEventsourceFactory() );
    Init_Eventsource_API();
}

IEventsource* CEventsourceFactory::createModuleByID(const rho::String& strID)
{
    return new CEventsourceImpl(strID);
}

IEventsourceSingleton* CEventsourceFactory::createModuleSingleton()
{
    return new CEventsourceSingleton();
}

void CEventsourceSingleton::enumerate(CMethodResult& oResult)
{
    rho::Vector<rho::String> arIDs;
    arIDs.addElement("SC1");
    arIDs.addElement("SC2");

    oResult.set(arIDs);
}

rho::String CEventsourceSingleton::getInitialDefaultID()
{
    CMethodResult oRes;
    enumerate(oRes);

    rho::Vector<rho::String>& arIDs = oRes.getStringArray();
        
    return arIDs[0];
}

}

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
rhodes-7.6.0 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-7.5.1 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-7.4.1 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-7.1.17 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-6.2.0 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-6.0.11 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-5.5.18 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-5.5.17 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-5.5.15 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-5.5.0.22 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-5.5.2 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-5.5.0.7 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-5.5.0.3 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
rhodes-5.5.0 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
tauplatform-1.0.3 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
tauplatform-1.0.2 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp
tauplatform-1.0.1 lib/commonAPI/eventsource/ext/platform/wm/src/Eventsource_impl.cpp