NAP
Public Member Functions | List of all members
PythonScriptService Class Reference

#include <pythonscriptservice.h>

Public Member Functions

 PythonScriptService (ServiceConfiguration *configuration)
 
void registerObjectCreators (rtti::Factory &factory) override
 
bool TryLoad (const std::string &modulePath, pybind11::module &module, utility::ErrorState &errorState)
 
- Public Member Functions inherited from Service
UNPREFIXED_MODULE_NAME_INPUTCASE Service (ServiceConfiguration *configuration)
 
virtual void getDependentServices (std::vector< rtti::TypeInfo > &dependencies) override
 
virtual bool init (nap::utility::ErrorState &errorState) override
 
virtual void update (double deltaTime) override
 
virtual void shutdown () override
 
 Service (ServiceConfiguration *configuration)
 
virtual ~Service ()
 
CoregetCore ()
 
const CoregetCore () const
 
std::string getTypeName () const
 
const ModulegetModule () const
 
 Service (Service &)=delete
 
Serviceoperator= (const Service &)=delete
 
 Service (Service &&)=delete
 
Serviceoperator= (Service &&)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from Service
virtual void getDependentServices (std::vector< rtti::TypeInfo > &dependencies)
 
virtual void created ()
 
virtual bool init (utility::ErrorState &error)
 
virtual void preUpdate (double deltaTime)
 
virtual void update (double deltaTime)
 
virtual void postUpdate (double deltaTime)
 
virtual void preShutdown ()
 
virtual void shutdown ()
 
virtual void preResourcesLoaded ()
 
virtual void postResourcesLoaded ()
 
template<typename SERVICE_CONFIG >
SERVICE_CONFIG * getConfiguration ()
 
template<typename SERVICE_CONFIG >
const SERVICE_CONFIG * getConfiguration () const
 
std::string getIniFilePath () const
 
std::string getIniFilePath (const std::string &appendix) const
 

Description

Python script services. Manages the python module and environment.

Inheritance diagram for PythonScriptService:
[legend]
Collaboration diagram for PythonScriptService:
[legend]

Constructor & Destructor Documentation

◆ PythonScriptService()

Member Function Documentation

◆ registerObjectCreators()

void registerObjectCreators ( rtti::Factory factory)
overridevirtual

Called by core. Registers all object creation methods for python specific NAP objects.

Parameters
factorythe factory to register the creation functions with.

Reimplemented from Service.

◆ TryLoad()

bool TryLoad ( const std::string &  modulePath,
pybind11::module &  module,
utility::ErrorState errorState 
)

Tries to load a python module into the NAP environment.

Parameters
modulePathpath to the python module to load
modulethe loaded module
errorStatecontains the error when loading failed.
Returns
if loading the module succeeded or not