Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions src/ITMA.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,29 @@
#include <memory>
#include <mutex>

//Windows dll EXPORT definition
//TODO: add Cross-platform dynamic library macros
//_ITMA_EXPORT definition
#ifdef ITMA_EXPORT
#define EXPORT __declspec(dllexport)
# if defined(_WIN32)
# define _ITMA_EXPORT __declspec(dllexport)
# elif defined(__GNUC__)
# define _ITMA_EXPORT __attribute__((visibility("default")))
# else
# define _ITMA_EXPORT
# endif
#elif defined(_WIN32)
# define _ITMA_EXPORT __declspec(dllimport)
#else
#define EXPORT __declspec(dllimport)
# define _ITMA_EXPORT
#endif //MTMA_EXPORT

/* TODO: Make EXPORT macro compatible with Unix compilers for dynamic link library creation. */

#include "custom_vector.h"
#include "custom_queue.h"

namespace ITMA
{
class pipe;

class EXPORT MContext
class _ITMA_EXPORT MContext
{
std::thread context;
CustomVector<std::shared_ptr<pipe>> pipes;
Expand All @@ -46,7 +51,7 @@ namespace ITMA
};

//ZMQPP socket style setup
class EXPORT Channel
class _ITMA_EXPORT Channel
{
std::shared_ptr<pipe> pip;
MContext & _ctx;
Expand Down Expand Up @@ -144,7 +149,7 @@ namespace ITMA
}
};

class EXPORT pipe
class _ITMA_EXPORT pipe
{
CustomQueue<Message> in; //incoming messages
CustomQueue<Message> out; //outgoing messages
Expand Down Expand Up @@ -244,4 +249,4 @@ namespace ITMA

}//namespace MTMA

#endif //ITMA_HPP
#endif //ITMA_HPP