Athena Developer Guide
Athena Developer Guide
Athena Developer Guide
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Athena</strong> Chapter 13 Framework services Version/Issue: 2.0.0<br />
Listing 13.8 A minimal service implementation<br />
// Factory for instantiation of service objects<br />
static SvcFactory s_factory;<br />
const ISvcFactory& SpecificServiceFactory = s_factory;<br />
// UNIQUE Interface identifiers defined elsewhere<br />
extern const IID& IID_IConcreteSvcType1;<br />
extern const IID& IID_IConcreteSvcType2;<br />
// queryInterface<br />
StatusCode SpecificService::queryInterface(const IID& riid, void** ppvIF) {<br />
if(IID_IConcreteSvcType1 == riid) {<br />
*ppvIF = dynamic_cast (this);<br />
return StatusCode::SUCCESS;<br />
} else if(IID_IConcreteSvcType2 == riid) {<br />
*ppvIF = dynamic_cast (this);<br />
return StatusCode::SUCCESS;<br />
} else {<br />
return Service::queryInterface(riid, ppvIF);<br />
}<br />
}<br />
StatusCode SpecificService::initialize() { ... }<br />
StatusCode SpecificService::finalize() { ... }<br />
// Implement the specifics ...<br />
SpecificService::method1() {...}<br />
SpecificService::method2() {...}<br />
SpecificService::method3() {...}<br />
SpecificService::method4() {...}<br />
page 122