Program Listing for File HostFunctionDescription.h

Return to documentation for file (include/flamegpu/model/HostFunctionDescription.h)

#ifndef INCLUDE_FLAMEGPU_MODEL_HOSTFUNCTIONDESCRIPTION_H_
#define INCLUDE_FLAMEGPU_MODEL_HOSTFUNCTIONDESCRIPTION_H_

#include <string>
#include <memory>
#include <vector>

#ifdef SWIG
#include "flamegpu/runtime/HostFunctionCallback.h"
#endif
#include "flamegpu/model/DependencyNode.h"
#include "flamegpu/model/LayerDescription.h"

namespace flamegpu {

class HostFunctionDescription : public DependencyNode {
    HostFunctionDescription(const HostFunctionDescription &other_function) = delete;
    HostFunctionDescription(HostFunctionDescription &&other_function) noexcept = delete;
    HostFunctionDescription& operator=(const HostFunctionDescription &other_function) = delete;
    HostFunctionDescription& operator=(HostFunctionDescription &&other_function) noexcept = delete;

 public:
    HostFunctionDescription(std::string host_function_name, FLAMEGPU_HOST_FUNCTION_POINTER host_function);
    HostFunctionDescription(std::string host_function_name, HostFunctionCallback *func_callback);

    bool operator==(const HostFunctionDescription& rhs) const;
    bool operator!=(const HostFunctionDescription& rhs) const;

    FLAMEGPU_HOST_FUNCTION_POINTER getFunctionPtr() const;
    HostFunctionCallback* getCallbackObject();
    std::string getName();

 private:
    FLAMEGPU_HOST_FUNCTION_POINTER function;
    HostFunctionCallback* callbackObject;
    std::string name;
};

}  // namespace flamegpu

#endif  // INCLUDE_FLAMEGPU_MODEL_HOSTFUNCTIONDESCRIPTION_H_