Inviwo  0.9.10.1
Inviwo documentation
inviwo::PythonScriptDisk Class Reference

#include <pythonscript.h>

+ Inheritance diagram for inviwo::PythonScriptDisk:

Public Member Functions

 PythonScriptDisk (const std::string &filename="")
 
virtual void setFilename (const std::string &filename) override
 
const BaseCallBack * onChange (std::function< void()> callback)
 
void removeOnChange (const BaseCallBack *callback)
 
- Public Member Functions inherited from inviwo::PythonScript
virtual ~PythonScript ()
 
void setSource (const std::string &source)
 
std::string getSource () const
 
bool run (std::unordered_map< std::string, pybind11::object > locals=std::unordered_map< std::string, pybind11::object >{}, std::function< void(pybind11::dict)> callback=nullptr)
 
bool run (std::function< void(pybind11::dict)> callback)
 
bool run (pybind11::dict locals, std::function< void(pybind11::dict)> callback=nullptr)
 
const std::string & getFilename () const
 
- Public Member Functions inherited from inviwo::FileObserver
 FileObserver (InviwoApplication *app)
 
 FileObserver (const std::string &filePath="")
 Starts observing file if existing. More...
 
 FileObserver (const FileObserver &)=delete
 
FileObserveroperator= (const FileObserver &)=delete
 
 FileObserver (FileObserver &&rhs)
 
FileObserveroperator= (FileObserver &&that)
 
virtual ~FileObserver ()
 
bool startFileObservation (const std::string &filePath)
 Starts observing file if it exists. More...
 
bool stopFileObservation (const std::string &filePath)
 Stops observing the file if being observed. More...
 
void stopAllObservation ()
 
const std::unordered_set< std::string > & getFiles () const
 
bool isObserved (const std::string &fileName) const
 

Additional Inherited Members

- Protected Attributes inherited from inviwo::FileObserver
InviwoApplicationapp_
 

Detailed Description

Class for handling PythonScripts that exists as files on disk. PythonScriptDisk will observe the file and reload it from disk when it detects it has changed.

See also
PythonScript
FileObserver

Member Function Documentation

◆ onChange()

const inviwo::BaseCallBack * inviwo::PythonScriptDisk::onChange ( std::function< void()>  callback)

Register a callback that will be called once the file has changed on disk.

◆ removeOnChange()

void inviwo::PythonScriptDisk::removeOnChange ( const BaseCallBack *  callback)

Remove a callback from the list of callbacks


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