RobWorkProject
Static Public Member Functions | List of all members
TaskSaver::Factory Class Reference

A factory for TaskSaver. This factory also defines an extension point for task savers. More...

#include <TaskSaver.hpp>

Inherits ExtensionPoint< TaskSaver >.

Static Public Member Functions

static TaskSaver::Ptr getTaskSaver (const std::string &format, const std::string &id="")
 Get saver for a specific format. More...
 
static bool hasTaskSaver (const std::string &format)
 Check if the factory has a TaskSaver for a specific format. More...
 
static std::vector< std::string > getSupportedFormats ()
 Get a list of supported formats. More...
 
static bool save (rwlibs::task::QTask::Ptr task, const std::string &filename)
 Save task to file. More...
 
static bool save (rwlibs::task::CartesianTask::Ptr task, const std::string &filename)
 Save task to file. More...
 

Additional Inherited Members

- Public Types inherited from ExtensionPoint< TaskSaver >
typedef rw::common::Ptr< ExtensionPointPtr
 smart pointer type of ExtensionPoint
 
- Public Member Functions inherited from ExtensionPoint< TaskSaver >
 ExtensionPoint (const std::string &id, const std::string &name, Plugin *plugin=NULL)
 Constructor. More...
 
const std::string & getId () const
 get unique identifier of this extensionpoint
 
const std::string & getName () const
 get human readable name of this extension point
 
const rw::common::PropertyMapgetSchema () const
 the schema describe the possible properties/configurations elements which is used in the PropertyMap. It contain examples of all possible configuration options. This can be used to configure any extensions that needs to attach to this extension point.
 
std::vector< Extension::DescriptorgetExtensionDescriptors () const
 get all extension descriptions of this extension point
 
std::vector< rw::common::Ptr< Extension > > getExtensions () const
 get all extensions of this extension point
 
- Protected Member Functions inherited from ExtensionPoint< TaskSaver >
rw::common::PropertyMapgetSchema ()
 the schema describe the possible properties/configurations elements which is used in the PropertyMap. The schema property map should just be loaded with all possible configuration options which the extension might use. More...
 

Detailed Description

A factory for TaskSaver. This factory also defines an extension point for task savers.

Member Function Documentation

◆ getSupportedFormats()

static std::vector<std::string> getSupportedFormats ( )
static

Get a list of supported formats.

Returns
list of supported formats.

◆ getTaskSaver()

static TaskSaver::Ptr getTaskSaver ( const std::string &  format,
const std::string &  id = "" 
)
static

Get saver for a specific format.

By default there will be a TaskSaver available for the XML format. If no id is given and there are no (user-added) extensions available for the XML format, a saver based on the DOMParser is used. The DOMParser is always used for the XML format if id is "DOM". If RobWork is compiled with Xerces support, a Xerces based saver is used if id is "Xerces".

Parameters
format[in] the extension (excluding initial dot).
id[in] (optional) identifier for a specific saver to use if multiple are available.
Returns
a suitable saver, or NULL if no suitable saver exist.

◆ hasTaskSaver()

static bool hasTaskSaver ( const std::string &  format)
static

Check if the factory has a TaskSaver for a specific format.

Parameters
format[in] the file ending excluding initial dot (such as xml)
Returns
true if a suitable saver exist, false otherwise.

◆ save() [1/2]

static bool save ( rwlibs::task::QTask::Ptr  task,
const std::string &  filename 
)
static

Save task to file.

Parameters
task[in] the task to save.
filename[in] the filename to save to.
Returns
true if file was written successfully.

◆ save() [2/2]

static bool save ( rwlibs::task::CartesianTask::Ptr  task,
const std::string &  filename 
)
static

Save task to file.

Parameters
task[in] the task to save.
filename[in] the filename to save to.
Returns
true if file was written successfully.

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