Skip to content
Closed
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions modules/platforms/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ if (WIN32)
add_definitions(-DUNICODE=1)

add_compile_options(/source-charset:utf-8)

set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif()

option (WITH_ODBC OFF)
Expand Down
2 changes: 2 additions & 0 deletions modules/platforms/cpp/binary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ if (WIN32)
add_library(${TARGET} SHARED $<TARGET_OBJECTS:${TARGET}-objlib>)

list(APPEND _target_libs ${TARGET}-objlib)

set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.binary")
else()
add_library(${TARGET} SHARED ${SOURCES})
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ namespace ignite
*
* @param writer Writer.
*/
void Write(ignite::binary::BinaryRawWriter& writer) const;
IGNITE_IMPORT_EXPORT void Write(ignite::binary::BinaryRawWriter& writer) const;

/**
* Read from data stream.
*
* @param reader reader.
*/
void Read(ignite::binary::BinaryRawReader& reader);
IGNITE_IMPORT_EXPORT void Read(ignite::binary::BinaryRawReader& reader);

private:
/** Type ID. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ namespace ignite

/* Specialization */
template<>
BinaryObjectImpl BinaryObjectImpl::GetField(const char* name) const;
IGNITE_IMPORT_EXPORT BinaryObjectImpl BinaryObjectImpl::GetField(const char* name) const;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace ignite
struct BinaryType;

template<>
struct BinaryType<IgniteError>
struct IGNITE_IMPORT_EXPORT BinaryType<IgniteError>
{
static int32_t GetTypeId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace ignite
* @param typeName Type name.
* @param typeId Type ID.
*/
BinaryTypeSnapshot(std::string typeName, int32_t typeId);
IGNITE_IMPORT_EXPORT BinaryTypeSnapshot(std::string typeName, int32_t typeId);

/**
* Copy constructor.
Expand Down Expand Up @@ -115,7 +115,7 @@ namespace ignite
* @param fieldName Field name.
* @param fieldTypeId Field type ID.
*/
void AddField(int32_t fieldId, const std::string& fieldName, int32_t fieldTypeId);
IGNITE_IMPORT_EXPORT void AddField(int32_t fieldId, const std::string& fieldName, int32_t fieldTypeId);

/**
* Copy fields from another snapshot.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ namespace ignite
{
namespace binary
{
void BinaryFieldMeta::Write(ignite::binary::BinaryRawWriter& writer) const
IGNITE_IMPORT_EXPORT void BinaryFieldMeta::Write(ignite::binary::BinaryRawWriter& writer) const
{
writer.WriteInt32(typeId);
writer.WriteInt32(fieldId);
}

void BinaryFieldMeta::Read(ignite::binary::BinaryRawReader& reader)
IGNITE_IMPORT_EXPORT void BinaryFieldMeta::Read(ignite::binary::BinaryRawReader& reader)
{
typeId = reader.ReadInt32();
fieldId = reader.ReadInt32();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ namespace ignite
}

template<>
BinaryObjectImpl BinaryObjectImpl::GetField(const char* name) const
IGNITE_IMPORT_EXPORT BinaryObjectImpl BinaryObjectImpl::GetField(const char* name) const
{
CheckIdResolver();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace ignite
{
namespace binary
{
BinaryTypeSnapshot::BinaryTypeSnapshot(std::string typeName, int32_t typeId) :
IGNITE_IMPORT_EXPORT BinaryTypeSnapshot::BinaryTypeSnapshot(std::string typeName, int32_t typeId) :
typeName(typeName),
typeId(typeId),
fieldIds(),
Expand All @@ -41,7 +41,7 @@ namespace ignite
// No-op.
}

void BinaryTypeSnapshot::AddField(int32_t fieldId, const std::string& fieldName, int32_t fieldTypeId)
IGNITE_IMPORT_EXPORT void BinaryTypeSnapshot::AddField(int32_t fieldId, const std::string& fieldName, int32_t fieldTypeId)
{
fieldIds.insert(fieldId);
fields[fieldName] = BinaryFieldMeta(fieldTypeId, fieldId);
Expand Down
27 changes: 19 additions & 8 deletions modules/platforms/cpp/cmake/FindIgnite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,37 @@ find_path(IGNITE_INCLUDE_DIR ignite/ignite.h
HINTS ${IGNITE_CPP_DIR}/include
PATH_SUFFIXES ignite)

find_library(IGNITE_LIB ignite HINTS ${IGNITE_CPP_DIR}/lib)
if (WIN32)
find_library(IGNITE_LIB ignite.core HINTS ${IGNITE_CPP_DIR}/lib)

find_library(IGNITE_COMMON_LIB ignite-common HINTS ${IGNITE_CPP_DIR}/lib)
find_library(IGNITE_COMMON_LIB ignite.common HINTS ${IGNITE_CPP_DIR}/lib)

find_library(IGNITE_NETWORK_LIB ignite-network HINTS ${IGNITE_CPP_DIR}/lib)
find_library(IGNITE_NETWORK_LIB ignite.network HINTS ${IGNITE_CPP_DIR}/lib)

find_library(IGNITE_JNI_LIB ignite-jni HINTS ${IGNITE_CPP_DIR}/lib)
find_library(IGNITE_JNI_LIB ignite.jni HINTS ${IGNITE_CPP_DIR}/lib)

find_library(IGNITE_THIN_CLIENT_LIB ignite-thin-client HINTS ${IGNITE_CPP_DIR}/lib)
find_library(IGNITE_THIN_CLIENT_LIB ignite.thin-client HINTS ${IGNITE_CPP_DIR}/lib)

find_library(IGNITE_ODBC_LIB ignite-odbc HINTS ${IGNITE_CPP_DIR}/lib)
find_library(IGNITE_BINARY_LIB ignite.binary HINTS ${IGNITE_CPP_DIR}/lib)
else()
find_library(IGNITE_LIB ignite HINTS ${IGNITE_CPP_DIR}/lib)

find_library(IGNITE_BINARY_LIB ignite-binary HINTS ${IGNITE_CPP_DIR}/lib)
find_library(IGNITE_COMMON_LIB ignite-common HINTS ${IGNITE_CPP_DIR}/lib)

find_library(IGNITE_NETWORK_LIB ignite-network HINTS ${IGNITE_CPP_DIR}/lib)

find_library(IGNITE_JNI_LIB ignite-jni HINTS ${IGNITE_CPP_DIR}/lib)

find_library(IGNITE_THIN_CLIENT_LIB ignite-thin-client HINTS ${IGNITE_CPP_DIR}/lib)

find_library(IGNITE_BINARY_LIB ignite-binary HINTS ${IGNITE_CPP_DIR}/lib)
endif()

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(Ignite DEFAULT_MSG
IGNITE_LIB
IGNITE_THIN_CLIENT_LIB
IGNITE_ODBC_LIB
IGNITE_BINARY_LIB
IGNITE_NETWORK_LIB
IGNITE_COMMON_LIB
Expand Down
9 changes: 8 additions & 1 deletion modules/platforms/cpp/cmake/FindODBC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ set(_odbc_required_libs_names)

### Try Windows Kits ##########################################################
if(WIN32)
set(_odbc_lib_names odbc32;)
# List names of ODBC libraries on Windows
if(NOT MINGW)
set(ODBC_LIBRARY odbc32.lib)
else()
set(ODBC_LIBRARY libodbc32.a)
endif()

set(_odbc_lib_names odbc32;)

# List additional libraries required to use ODBC library
if(MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
Expand Down
2 changes: 2 additions & 0 deletions modules/platforms/cpp/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ if (WIN32)
add_library(${TARGET}-objlib OBJECT ${SOURCES})

add_library(${TARGET} SHARED $<TARGET_OBJECTS:${TARGET}-objlib>)

set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.common")

list(APPEND _target_libs ${TARGET}-objlib)
else()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace ignite
/**
* Big integer number implementation.
*/
class BigInteger
class IGNITE_IMPORT_EXPORT BigInteger
{
friend class Decimal;
public:
Expand Down Expand Up @@ -471,7 +471,7 @@ namespace ignite
* @param val2 Second value.
* @return True if equal.
*/
bool IGNITE_IMPORT_EXPORT operator==(const BigInteger& val1, const BigInteger& val2);
IGNITE_IMPORT_EXPORT bool operator==(const BigInteger& val1, const BigInteger& val2);

/**
* Comparison operator.
Expand All @@ -480,7 +480,7 @@ namespace ignite
* @param val2 Second value.
* @return True if not equal.
*/
bool IGNITE_IMPORT_EXPORT operator!=(const BigInteger& val1, const BigInteger& val2);
IGNITE_IMPORT_EXPORT bool operator!=(const BigInteger& val1, const BigInteger& val2);

/**
* Comparison operator.
Expand All @@ -489,7 +489,7 @@ namespace ignite
* @param val2 Second value.
* @return True if less.
*/
bool IGNITE_IMPORT_EXPORT operator<(const BigInteger& val1, const BigInteger& val2);
IGNITE_IMPORT_EXPORT bool operator<(const BigInteger& val1, const BigInteger& val2);

/**
* Comparison operator.
Expand All @@ -498,7 +498,7 @@ namespace ignite
* @param val2 Second value.
* @return True if less or equal.
*/
bool IGNITE_IMPORT_EXPORT operator<=(const BigInteger& val1, const BigInteger& val2);
IGNITE_IMPORT_EXPORT bool operator<=(const BigInteger& val1, const BigInteger& val2);

/**
* Comparison operator.
Expand All @@ -507,7 +507,7 @@ namespace ignite
* @param val2 Second value.
* @return True if gretter.
*/
bool IGNITE_IMPORT_EXPORT operator>(const BigInteger& val1, const BigInteger& val2);
IGNITE_IMPORT_EXPORT bool operator>(const BigInteger& val1, const BigInteger& val2);

/**
* Comparison operator.
Expand All @@ -516,7 +516,7 @@ namespace ignite
* @param val2 Second value.
* @return True if gretter or equal.
*/
bool IGNITE_IMPORT_EXPORT operator>=(const BigInteger& val1, const BigInteger& val2);
IGNITE_IMPORT_EXPORT bool operator>=(const BigInteger& val1, const BigInteger& val2);
}
}

Expand Down
14 changes: 7 additions & 7 deletions modules/platforms/cpp/common/include/ignite/common/decimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace ignite
/**
* Big decimal number implementation.
*/
class Decimal
class IGNITE_IMPORT_EXPORT Decimal
{
public:
/**
Expand Down Expand Up @@ -475,7 +475,7 @@ namespace ignite
* @param val2 Second value.
* @return True if equal.
*/
bool IGNITE_IMPORT_EXPORT operator==(const Decimal& val1, const Decimal& val2);
IGNITE_IMPORT_EXPORT bool operator==(const Decimal& val1, const Decimal& val2);

/**
* Comparison operator.
Expand All @@ -484,7 +484,7 @@ namespace ignite
* @param val2 Second value.
* @return True if not equal.
*/
bool IGNITE_IMPORT_EXPORT operator!=(const Decimal& val1, const Decimal& val2);
IGNITE_IMPORT_EXPORT bool operator!=(const Decimal& val1, const Decimal& val2);

/**
* Comparison operator.
Expand All @@ -493,7 +493,7 @@ namespace ignite
* @param val2 Second value.
* @return True if less.
*/
bool IGNITE_IMPORT_EXPORT operator<(const Decimal& val1, const Decimal& val2);
IGNITE_IMPORT_EXPORT bool operator<(const Decimal& val1, const Decimal& val2);

/**
* Comparison operator.
Expand All @@ -502,7 +502,7 @@ namespace ignite
* @param val2 Second value.
* @return True if less or equal.
*/
bool IGNITE_IMPORT_EXPORT operator<=(const Decimal& val1, const Decimal& val2);
IGNITE_IMPORT_EXPORT bool operator<=(const Decimal& val1, const Decimal& val2);

/**
* Comparison operator.
Expand All @@ -511,7 +511,7 @@ namespace ignite
* @param val2 Second value.
* @return True if gretter.
*/
bool IGNITE_IMPORT_EXPORT operator>(const Decimal& val1, const Decimal& val2);
IGNITE_IMPORT_EXPORT bool operator>(const Decimal& val1, const Decimal& val2);

/**
* Comparison operator.
Expand All @@ -520,7 +520,7 @@ namespace ignite
* @param val2 Second value.
* @return True if gretter or equal.
*/
bool IGNITE_IMPORT_EXPORT operator>=(const Decimal& val1, const Decimal& val2);
IGNITE_IMPORT_EXPORT bool operator>=(const Decimal& val1, const Decimal& val2);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace ignite
*
* @return Random seed.
*/
unsigned GetRandSeed();
IGNITE_IMPORT_EXPORT unsigned GetRandSeed();
}
}

Expand Down
12 changes: 6 additions & 6 deletions modules/platforms/cpp/common/include/ignite/common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ namespace ignite
* @param sec Sec.
* @return Date.
*/
Date MakeDateGmt(int year = 1900, int month = 1,
IGNITE_FRIEND_EXPORT Date MakeDateGmt(int year = 1900, int month = 1,
int day = 1, int hour = 0, int min = 0, int sec = 0);

/**
Expand All @@ -407,7 +407,7 @@ namespace ignite
* @param sec Sec.
* @return Date.
*/
Date MakeDateLocal(int year = 1900, int month = 1,
IGNITE_FRIEND_EXPORT Date MakeDateLocal(int year = 1900, int month = 1,
int day = 1, int hour = 0, int min = 0, int sec = 0);

/**
Expand All @@ -420,7 +420,7 @@ namespace ignite
* @param sec Second.
* @return Time.
*/
Time MakeTimeGmt(int hour = 0, int min = 0, int sec = 0);
IGNITE_FRIEND_EXPORT Time MakeTimeGmt(int hour = 0, int min = 0, int sec = 0);

/**
* Make Time in human understandable way.
Expand All @@ -432,7 +432,7 @@ namespace ignite
* @param sec Second.
* @return Time.
*/
Time MakeTimeLocal(int hour = 0, int min = 0, int sec = 0);
IGNITE_FRIEND_EXPORT Time MakeTimeLocal(int hour = 0, int min = 0, int sec = 0);

/**
* Make Timestamp in human understandable way.
Expand All @@ -448,7 +448,7 @@ namespace ignite
* @param ns Nanosecond.
* @return Timestamp.
*/
Timestamp MakeTimestampGmt(int year = 1900, int month = 1,
IGNITE_FRIEND_EXPORT Timestamp MakeTimestampGmt(int year = 1900, int month = 1,
int day = 1, int hour = 0, int min = 0, int sec = 0, long ns = 0);

/**
Expand All @@ -465,7 +465,7 @@ namespace ignite
* @param ns Nanosecond.
* @return Timestamp.
*/
Timestamp MakeTimestampLocal(int year = 1900, int month = 1,
IGNITE_FRIEND_EXPORT Timestamp MakeTimestampLocal(int year = 1900, int month = 1,
int day = 1, int hour = 0, int min = 0, int sec = 0, long ns = 0);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ namespace ignite
return ostr;
}

unsigned GetRandSeed()
IGNITE_IMPORT_EXPORT unsigned GetRandSeed()
{
timespec ts;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ namespace ignite
/**
* Primitives for atomic access.
*/
class Atomics
class IGNITE_IMPORT_EXPORT Atomics
{
public:
/**
Expand Down
Loading