Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
ScroomInterfaceImpl Class Reference
Inheritance diagram for ScroomInterfaceImpl:
Inheritance graph
Collaboration diagram for ScroomInterfaceImpl:
Collaboration graph

Public Types

using Ptr = std::shared_ptr< ScroomInterfaceImpl >
 
- Public Types inherited from ScroomInterface
using Ptr = std::shared_ptr< ScroomInterface >
 

Public Member Functions

PresentationInterface::Ptr newPresentation (const std::string &name) override
 
Aggregate::Ptr newAggregate (const std::string &name) override
 
PresentationInterface::Ptr loadPresentation (const std::string &name, const std::string &relativeTo=std::string()) override
 
void showPresentation (PresentationInterface::Ptr const &presentation) override
 

Static Public Member Functions

static Ptr instance ()
 

Private Member Functions

 ScroomInterfaceImpl ()=default
 

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ ScroomInterfaceImpl()

ScroomInterfaceImpl::ScroomInterfaceImpl ( )
privatedefault

Referenced by instance().

Here is the caller graph for this function:

Member Function Documentation

◆ instance()

ScroomInterfaceImpl::Ptr ScroomInterfaceImpl::instance ( )
static
277{
278 static ScroomInterfaceImpl::Ptr const i(new ScroomInterfaceImpl());
279 return i;
280}
std::shared_ptr< ScroomInterfaceImpl > Ptr
Definition loader.cc:153
ScroomInterfaceImpl()=default

Referenced by load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadPresentation()

PresentationInterface::Ptr ScroomInterfaceImpl::loadPresentation ( const std::string &  name,
const std::string &  relativeTo = std::string() 
)
overridevirtual

Implements ScroomInterface.

331{
332 boost::filesystem::path name(n);
333 boost::filesystem::path const relativeTo(rt);
334
335 if(!name.is_absolute() && relativeTo.has_parent_path())
336 {
337 name = relativeTo.parent_path() / name;
338 }
339
340 return ::loadPresentation(name.string());
341}

◆ newAggregate()

Aggregate::Ptr ScroomInterfaceImpl::newAggregate ( const std::string &  name)
overridevirtual

Implements ScroomInterface.

306{
307 std::map<std::string, NewAggregateInterface::Ptr> const& newAggregateInterfaces =
308 PluginManager::getInstance()->getNewAggregateInterfaces();
309 auto i = newAggregateInterfaces.find(name);
310 if(i != newAggregateInterfaces.end())
311 {
312 Aggregate::Ptr aggregate = i->second->createNew();
313 if(aggregate)
314 {
315 PresentationInterface::Ptr const aggregatePresentation = std::dynamic_pointer_cast<PresentationInterface>(aggregate);
316
317 if(aggregatePresentation)
318 {
319 on_presentation_created(aggregatePresentation);
320 }
321
322 return aggregate;
323 }
324
325 throw std::invalid_argument("Failed to create a new" + name);
326 }
327 throw std::invalid_argument("Don't know how to create a new " + name);
328}
void on_presentation_created(const PresentationInterface::Ptr &presentation)
Definition callbacks.cc:634
std::shared_ptr< Aggregate > Ptr
Definition presentationinterface.hh:146
static PluginManager::Ptr getInstance()
Definition pluginmanager.cc:334
std::shared_ptr< PresentationInterface > Ptr
Definition presentationinterface.hh:73
Here is the call graph for this function:

◆ newPresentation()

PresentationInterface::Ptr ScroomInterfaceImpl::newPresentation ( const std::string &  name)
overridevirtual

Implements ScroomInterface.

283{
284 const std::map<NewPresentationInterface::Ptr, std::string>& newPresentationInterfaces =
285 PluginManager::getInstance()->getNewPresentationInterfaces();
286
287 for(auto const& p: newPresentationInterfaces)
288 {
289 if(p.second == name)
290 {
291 PresentationInterface::Ptr presentation = p.first->createNew();
292 if(presentation)
293 {
294 on_presentation_created(presentation);
295 return presentation;
296 }
297
298 throw std::invalid_argument("Failed to create a new " + name);
299 }
300 }
301
302 throw std::invalid_argument("Don't know how to create a new " + name);
303}
PresentationInterfaceStub::Ptr const p
Definition determine-size-test.cc:172
Here is the call graph for this function:

◆ showPresentation()

void ScroomInterfaceImpl::showPresentation ( PresentationInterface::Ptr const &  presentation)
overridevirtual

Implements ScroomInterface.

344{
345 on_presentation_created(presentation);
346 find_or_create_scroom(presentation);
347}
void find_or_create_scroom(const PresentationInterface::Ptr &presentation)
Definition callbacks.cc:487
Here is the call graph for this function:

The documentation for this class was generated from the following file: