Sha256: d067dd766d244b69fdd7777e2a8da8a56590291806548d4323a8ac16ee040ba3

Contents?: true

Size: 1.77 KB

Versions: 17

Compression:

Stored size: 1.77 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 enable( const rho::Hashtable<rho::String, rho::String>& propertyMap, CMethodResult& oResult){}
    virtual void start(CMethodResult& oResult){}
    virtual void stop(CMethodResult& oResult){}
    virtual void disable(CMethodResult& oResult){}
    virtual void take( const rho::Hashtable<rho::String, rho::String>& propertyMap, CMethodResult& oResult){}

};

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/wp8/src/Eventsource_impl.cpp
rhodes-7.5.1 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-7.4.1 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-7.1.17 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-6.2.0 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-6.0.11 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-5.5.18 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-5.5.17 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-5.5.15 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-5.5.0.22 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-5.5.2 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-5.5.0.7 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-5.5.0.3 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
rhodes-5.5.0 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
tauplatform-1.0.3 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
tauplatform-1.0.2 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp
tauplatform-1.0.1 lib/commonAPI/eventsource/ext/platform/wp8/src/Eventsource_impl.cpp