Files

114 lines
3.1 KiB
C++

/**
* @file include/ActivMiddleware/ActivFramework/External.h
*
* @brief Import rules for ActivFramework exports.
*/
#if (!defined ACTIV_FRAMEWORK_EXTERNAL_H)
#define ACTIV_FRAMEWORK_EXTERNAL_H
#if (!defined ACTIV_FRAMEWORK_API)
# if (!defined ACTIV_STATIC)
# define ACTIV_FRAMEWORK_API ACTIV_IMPORT_DLL
# else
# define ACTIV_FRAMEWORK_API ACTIV_IMPORT_LIB
# endif // (!defined ACTIV_STATIC)
#endif // (!defined ACTIV_FRAMEWORK_API)
#include "ActivMiddleware/ActivMiddleware.h"
#include "ActivMiddleware/ActivFramework/BasicTypes.h"
#include "ActivMiddleware/ActivFramework/MessageTypes.h"
// Enable ef_vi for x86-64, Linux, c++11
#if (defined ACTIV_PROCESSOR_X86_64) && (defined ACTIV_PLATFORM_LINUX) && (ACTIV_CPLUSPLUS >= ACTIV_CPLUSPLUS_11)
# define ACTIV_ENABLE_EFVI
#endif
// Enable DPDK for x86-64, Linux/Windows, c++11
#if (defined ACTIV_PROCESSOR_X86_64) && (ACTIV_CPLUSPLUS >= ACTIV_CPLUSPLUS_11)
# if ((defined ACTIV_PLATFORM_LINUX) || (defined ACTIV_PLATFORM_WINDOWS))
# define ACTIV_ENABLE_DPDK
#endif
#endif
// Enable exanic for Windows
#if (defined ACTIV_PLATFORM_WINDOWS)
# define ACTIV_ENABLE_EXANIC
#endif
//! Activ namespace.
namespace Activ
{
//! List of agent scopes.
#define ACTIV_AGENT_SCOPE_LIST(d) \
d(AGENT_SCOPE_LOCAL, "Local") \
d(AGENT_SCOPE_GLOBAL, "Global") \
d(AGENT_SCOPE_REMOTE, "Remote")
/**
* @brief Agent scope type.
*
* AGENT_SCOPE_LOCAL within the agent space
* AGENT_SCOPE_GLOBAL local & remote
* AGENT_SCOPE_REMOTE outside the agent space
*/
typedef byte_t AgentScope;
enum
{
ACTIV_AGENT_SCOPE_LIST(ACTIV_DECLARE_HIDDEN_ELEMENT_1)
NUM_AGENT_SCOPES
};
#define ACTIV_DECLARE_AGENT_SCOPE(a, b) ACTIV_DECLARE_CONSTANT_ELEMENT_1(AgentScope, a, b)
ACTIV_AGENT_SCOPE_LIST(ACTIV_DECLARE_AGENT_SCOPE)
#undef ACTIV_DECLARE_AGENT_SCOPE
//! Convert an AgentScope to a string.
ACTIV_FRAMEWORK_API const String AgentScopeToString(const AgentScope agentScope);
/**
* @brief Convert a string to an AgentScope.
*
* @param str
*
* @return The AgentScope.
*
* @throw std::exception if the conversion wasn't possible.
*/
ACTIV_FRAMEWORK_API AgentScope StringToAgentScope(const String &str);
// ---------------------------------------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------------------
//! List of system object (endpoints, heaps) visibility types.
#define ACTIV_FRAMEWORK_OBJECT_SCOPE(d) \
d(OBJECT_SCOPE_SYSTEM, "system") \
d(OBJECT_SCOPE_PROCESS, "process")
//! ObjectScope enumeration.
enum ObjectScope
{
ACTIV_FRAMEWORK_OBJECT_SCOPE(ACTIV_DECLARE_ELEMENT_1_WITH_COMMA)
NUM_OBJECT_SCOPES
};
//! Convert an ObjectScope to a string.
ACTIV_FRAMEWORK_API const String ObjectScopeToString(const ObjectScope objectScope);
/**
* @brief Convert a string to an ObjectScope.
*
* @param str
*
* @return The ObjectScope.
*
* @throw std::exception if the conversion wasn't possible.
*/
ACTIV_FRAMEWORK_API ObjectScope ObjectScopeToString(const String &str);
} // namespace Activ
#endif // (!defined ACTIV_FRAMEWORK_EXTERNAL_H)