Scroom  0.14
ScroomInterfaceImpl Class Reference
Inheritance diagram for ScroomInterfaceImpl:
Inheritance graph
Collaboration diagram for ScroomInterfaceImpl:
Collaboration graph

Public Types

using Ptr = boost::shared_ptr< ScroomInterfaceImpl >
 
- Public Types inherited from ScroomInterface
using Ptr = boost::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

using ScroomInterfaceImpl::Ptr = boost::shared_ptr<ScroomInterfaceImpl>

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
280 {
281  static ScroomInterfaceImpl::Ptr const i(new ScroomInterfaceImpl());
282  return i;
283 }

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.

334 {
335  boost::filesystem::path name(n);
336  boost::filesystem::path const relativeTo(rt);
337 
338  if(!name.is_absolute() && relativeTo.has_parent_path())
339  {
340  name = relativeTo.parent_path() / name;
341  }
342 
343  return ::loadPresentation(name.string());
344 }
Here is the call graph for this function:

◆ newAggregate()

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

Implements ScroomInterface.

309 {
310  std::map<std::string, NewAggregateInterface::Ptr> const& newAggregateInterfaces =
311  PluginManager::getInstance()->getNewAggregateInterfaces();
312  auto i = newAggregateInterfaces.find(name);
313  if(i != newAggregateInterfaces.end())
314  {
315  Aggregate::Ptr aggregate = i->second->createNew();
316  if(aggregate)
317  {
318  PresentationInterface::Ptr const aggregatePresentation = boost::dynamic_pointer_cast<PresentationInterface>(aggregate);
319 
320  if(aggregatePresentation)
321  {
322  on_presentation_created(aggregatePresentation);
323  }
324 
325  return aggregate;
326  }
327 
328  throw std::invalid_argument("Failed to create a new" + name);
329  }
330  throw std::invalid_argument("Don't know how to create a new " + name);
331 }
Here is the call graph for this function:

◆ newPresentation()

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

Implements ScroomInterface.

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

◆ showPresentation()

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

Implements ScroomInterface.

347 {
348  on_presentation_created(presentation);
349  find_or_create_scroom(presentation);
350 }
Here is the call graph for this function:

The documentation for this class was generated from the following file:
find_or_create_scroom
void find_or_create_scroom(const PresentationInterface::Ptr &presentation)
Definition: callbacks.cc:481
ScroomInterfaceImpl::Ptr
boost::shared_ptr< ScroomInterfaceImpl > Ptr
Definition: loader.cc:156
loadPresentation
PresentationInterface::Ptr loadPresentation(const std::string &filename)
Definition: loader.cc:189
on_presentation_created
void on_presentation_created(const PresentationInterface::Ptr &presentation)
Definition: callbacks.cc:623
PresentationInterface::Ptr
boost::shared_ptr< PresentationInterface > Ptr
Definition: presentationinterface.hh:74
PluginManager::getInstance
static PluginManager::Ptr getInstance()
Definition: pluginmanager.cc:330
ScroomInterfaceImpl::ScroomInterfaceImpl
ScroomInterfaceImpl()=default
Aggregate::Ptr
boost::shared_ptr< Aggregate > Ptr
Definition: presentationinterface.hh:147