Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------- ConnectionManager.h --------------------
- #ifndef CONNECTIONMANAGER_H
- #define CONNECTIONMANAGER_H
- #include <utility>
- #include "List.h"
- class ModelComponent;
- typedef std::pair<ModelComponent*, unsigned int> Connection;
- class ConnectionManager {
- public:
- ConnectionManager();
- ConnectionManager(const ConnectionManager& orig);
- virtual ~ConnectionManager();
- public:
- unsigned int size();
- ModelComponent* front(); /*!< DEPRECTED. Use frontConnection instead */
- ModelComponent* getAtRank(unsigned int rank); /*!< DEPRECTED. Use getConnectionAtRank instead */
- Connection* frontConnection();
- Connection* getConnectionAtRank(unsigned int rank);
- void insert(ModelComponent* component, unsigned int inputNumber = 0);
- std::list<Connection*>* getList() const;
- private:
- List<Connection*>* _nextConnections = new List<Connection*>();
- };
- #endif /* CONNECTIONMANAGER_H */
- -------------------- ConnectionManagerWrapper.h --------------------
- #ifndef CONNECTION_MANAGER_WRAPPER_H
- #define CONNECTION_MANAGER_WRAPPER_H
- #include "../ConnectionManager.h"
- #include <pybind11/pybind11.h>
- #include <pybind11/stl.h>
- namespace py = pybind11;
- void initConnectionManager(py::module &m) {
- py::class_<ConnectionManager>(m, "ConnectionManager")
- .def(py::init())
- .def(py::init<ConnectionManager&>())
- .def("size", &ConnectionManager::size)
- .def("front", &ConnectionManager::front)
- .def("getAtRank", &ConnectionManager::getAtRank)
- // .def("frontConnection", &ConnectionManager::frontConnection)
- // .def("getConnectionAtRank", &ConnectionManager::getConnectionAtRank)
- .def("insert", &ConnectionManager::insert,
- py::arg("component"), py::arg("inputNumber") = 0)
- .def("getList", &ConnectionManager::getList);
- }
- #endif /* CONNECTION_MANAGER_WRAPPER_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement