LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
LimaCommon.h File Reference
#include <QtGlobal>
#include <QtCore/QRecursiveMutex>
#include <cstdint>
#include <boost/serialization/strong_typedef.hpp>
#include <string>
#include <stdexcept>
#include <sstream>
#include <common/QsLog/QsLog.h>
#include <common/QsLog/QsLogCategories.h>
#include "common/QsLog/QsLogDest.h"
#include "LinguisticCode/StdBitset.h"

Go to the source code of this file.

Classes

class  LogInit
 
class  Lima::LimaException
 The main LIMA exception class. More...
 
class  Lima::InvalidConfiguration
 Use this exception to signal an error in one of the configuration files. More...
 
class  Lima::MediaNotInitialized
 Use this exception to signal that a media is used which has not been initialized. More...
 
class  Lima::AccessByStringNotInitialized
 Use this exception to signal the used of a wrongly initialized LIMA dictionary. More...
 
class  Lima::AccessByStringOutOfRange
 Use this exception to signal a wrong access to a LIMA dictionary. More...
 
class  Lima::XMLException
 Throw this exception when encountering problems with XML files opening or parsing. More...
 

Namespaces

namespace  Lima
 NAUTITIA.
 

Macros

#define QTENDL   Qt::endl
 
#define LIMA_DATA_EXPORT
 
#define LIMA_DATAHANDLER_EXPORT
 
#define LIMA_FSAACCESS_EXPORT
 
#define LIMA_MEDIAPROCESSORS_EXPORT
 
#define LIMA_MEDIATICDATA_EXPORT
 
#define LIMA_COMMONMISC_EXPORT
 
#define LIMA_COMMONTOOLS_EXPORT
 
#define LIMA_PROCESSUNITFRAMEWORK_EXPORT
 
#define LIMA_TIME_EXPORT
 
#define LIMA_XMLCONFIGURATIONFILES_EXPORT
 
#define LIMA_COMMON_EXPORT
 
#define LIMA_DEBUG   0
 
#define LTRACE   QLOG_TRACE()
 
#define LDEBUG   QLOG_DEBUG()
 
#define LINFO   QLOG_INFO()
 
#define LNOTICE   QLOG_INFO()
 
#define LWARN   QLOG_WARN()
 
#define LERROR   QLOG_ERROR()
 
#define LFATAL   QLOG_FATAL()
 
#define LOGINIT(X)
 
#define LENDL   ". Note: LENDL is deprecated. It will be removed from a future release."
 
#define ABSTRACTFACTORYPATTERNLOGINIT   LOGINIT("Common::AbstractFactoryPattern")
 
#define ABSTRACTPROCESSINGCLIENTLOGINIT   LOGINIT("Common::AbstractProcessingClient")
 
#define AGLOGINIT   LOGINIT("Common::AnnotationGraph")
 
#define BOWLOGINIT   LOGINIT("Common::BOW");
 
#define CLIENTFACTORYLOGINIT   LOGINIT("Common::ClientFactory")
 
#define COMPSTRACCESSLOGINIT   LOGINIT("Common::CompStrAccess")
 
#define FSAAHASHLOGINIT   LOGINIT("Common::FsaAccessHash")
 
#define FSAAIOLOGINIT   LOGINIT("Common::FsaAccessIO")
 
#define FSAALOGINIT   LOGINIT("Common::FsaAccess")
 
#define HANDLERLOGINIT   LOGINIT("Common::Handler")
 
#define LDATALOGINIT   LOGINIT("Common::LanguageData")
 
#define MDATALOGINIT   LOGINIT("Common::MediaticData")
 
#define MISCLOGINIT   LOGINIT("Common::Misc")
 
#define PROCESSORSLOGINIT   LOGINIT("Common::Processors")
 
#define PROCESSUNITFRAMEWORKLOGINIT   LOGINIT("Common::ProcessUnitFramework")
 
#define PROPERTYCODELOGINIT   LOGINIT("Common::PropertyCode")
 
#define STRINGMAPLOGINIT   LOGINIT("Common::StringMap")
 
#define STRPOOLLOGINIT   LOGINIT("Common::StringPool")
 
#define TGVLOGINIT   LOGINIT("Common::TGV")
 
#define XMLCFGLOGINIT   LOGINIT("Common::XMLConfigurationFiles")
 
#define DYNAMICLIBMANAGERLOGINIT   LOGINIT("Common::DynamicLibrariesManager")
 
#define LIMA_UNUSED(x)   (void)x;
 
#define USE_STD_BITSET_FOR_LINGUISTIC_CODE
 
#define UNDEFLANG   static_cast<Lima::MediaId>(std::numeric_limits<uint8_t>::max())
 
#define LIMA_EXCEPTION(X)
 This macro writes the message X to a previously configured error stream before throwing a LimaException with the same message.
 
#define LIMA_EXCEPTION_SELECT(X, Y)
 This macro writes the message X to a previously configured error stream before throwing a Y exception (Y is an exception class name) with the same message.
 
#define LIMA_EXCEPTION_LOGINIT(X, Y)
 This macro writes the message Y to the error stream configured by its first parameter X, before throwing LimaException with the same message.
 
#define LIMA_EXCEPTION_SELECT_LOGINIT(X, Y, Z)
 This macro writes the message Y to the error stream configured by its first parameter X, before throwing a Z exception (Z is an exception class name) with the same message.
 

Enumerations

enum  Lima::LimaStatusCode {
  Lima::SUCCESS_ID , Lima::UNKNOWN_ERROR , Lima::CANNOT_OPEN_FILE_ERROR , Lima::OUT_OF_RANGE_ERROR ,
  Lima::UNSUPPORTED_LANGUAGE , Lima::INVALID_CONFIGURATION , Lima::MISSING_DATA , Lima::UNKNOWN_FORMAT
}
 

Functions

QDebug & operator<< (QDebug &qd, const std::string &str)
 
 Lima::BOOST_STRONG_TYPEDEF (char, NoParameters)
 
 Lima::BOOST_STRONG_TYPEDEF (uint8_t, MediaId)
 

Macro Definition Documentation

◆ ABSTRACTFACTORYPATTERNLOGINIT

#define ABSTRACTFACTORYPATTERNLOGINIT   LOGINIT("Common::AbstractFactoryPattern")

Definition at line 198 of file LimaCommon.h.

◆ ABSTRACTPROCESSINGCLIENTLOGINIT

#define ABSTRACTPROCESSINGCLIENTLOGINIT   LOGINIT("Common::AbstractProcessingClient")

Definition at line 199 of file LimaCommon.h.

◆ AGLOGINIT

#define AGLOGINIT   LOGINIT("Common::AnnotationGraph")

Definition at line 200 of file LimaCommon.h.

◆ BOWLOGINIT

#define BOWLOGINIT   LOGINIT("Common::BOW");

Definition at line 201 of file LimaCommon.h.

◆ CLIENTFACTORYLOGINIT

#define CLIENTFACTORYLOGINIT   LOGINIT("Common::ClientFactory")

Definition at line 202 of file LimaCommon.h.

◆ COMPSTRACCESSLOGINIT

#define COMPSTRACCESSLOGINIT   LOGINIT("Common::CompStrAccess")

Definition at line 203 of file LimaCommon.h.

◆ DYNAMICLIBMANAGERLOGINIT

#define DYNAMICLIBMANAGERLOGINIT   LOGINIT("Common::DynamicLibrariesManager")

Definition at line 218 of file LimaCommon.h.

◆ FSAAHASHLOGINIT

#define FSAAHASHLOGINIT   LOGINIT("Common::FsaAccessHash")

Definition at line 204 of file LimaCommon.h.

◆ FSAAIOLOGINIT

#define FSAAIOLOGINIT   LOGINIT("Common::FsaAccessIO")

Definition at line 205 of file LimaCommon.h.

◆ FSAALOGINIT

#define FSAALOGINIT   LOGINIT("Common::FsaAccess")

Definition at line 206 of file LimaCommon.h.

◆ HANDLERLOGINIT

#define HANDLERLOGINIT   LOGINIT("Common::Handler")

Definition at line 207 of file LimaCommon.h.

◆ LDATALOGINIT

#define LDATALOGINIT   LOGINIT("Common::LanguageData")

Definition at line 208 of file LimaCommon.h.

◆ LDEBUG

#define LDEBUG   QLOG_DEBUG()

Definition at line 157 of file LimaCommon.h.

◆ LENDL

#define LENDL   ". Note: LENDL is deprecated. It will be removed from a future release."

Definition at line 196 of file LimaCommon.h.

◆ LERROR

#define LERROR   QLOG_ERROR()

Definition at line 161 of file LimaCommon.h.

◆ LFATAL

#define LFATAL   QLOG_FATAL()

Definition at line 162 of file LimaCommon.h.

◆ LIMA_COMMON_EXPORT

#define LIMA_COMMON_EXPORT

Definition at line 138 of file LimaCommon.h.

◆ LIMA_COMMONMISC_EXPORT

#define LIMA_COMMONMISC_EXPORT

Definition at line 133 of file LimaCommon.h.

◆ LIMA_COMMONTOOLS_EXPORT

#define LIMA_COMMONTOOLS_EXPORT

Definition at line 134 of file LimaCommon.h.

◆ LIMA_DATA_EXPORT

#define LIMA_DATA_EXPORT

Definition at line 128 of file LimaCommon.h.

◆ LIMA_DATAHANDLER_EXPORT

#define LIMA_DATAHANDLER_EXPORT

Definition at line 129 of file LimaCommon.h.

◆ LIMA_DEBUG

#define LIMA_DEBUG   0

Definition at line 146 of file LimaCommon.h.

◆ LIMA_EXCEPTION

#define LIMA_EXCEPTION (   X)
Value:
{ \
QString errorString; \
QTextStream qts(&errorString); \
qts << __FILE__ << ":" << __LINE__ << ": " << X ; \
LERROR << errorString; \
throw LimaException(errorString); \
}
#define LERROR
Definition LimaCommon.h:161

This macro writes the message X to a previously configured error stream before throwing a LimaException with the same message.

Definition at line 293 of file LimaCommon.h.

◆ LIMA_EXCEPTION_LOGINIT

#define LIMA_EXCEPTION_LOGINIT (   X,
  Y 
)
Value:
{ \
X ; \
QString errorString; \
QTextStream qts(&errorString); \
qts << __FILE__ << ":" << __LINE__ << ": " << Y ; \
LERROR << errorString; \
throw Lima::LimaException(errorString); \
}
The main LIMA exception class.
Definition LimaCommon.h:262

This macro writes the message Y to the error stream configured by its first parameter X, before throwing LimaException with the same message.

Definition at line 318 of file LimaCommon.h.

◆ LIMA_EXCEPTION_SELECT

#define LIMA_EXCEPTION_SELECT (   X,
  Y 
)
Value:
{ \
QString errorString; \
QTextStream qts(&errorString); \
qts << __FILE__ << ":" << __LINE__ << ": " << X ; \
LERROR << errorString; \
throw Y(errorString); \
}

This macro writes the message X to a previously configured error stream before throwing a Y exception (Y is an exception class name) with the same message.

Definition at line 306 of file LimaCommon.h.

◆ LIMA_EXCEPTION_SELECT_LOGINIT

#define LIMA_EXCEPTION_SELECT_LOGINIT (   X,
  Y,
  Z 
)
Value:
{ \
X ; \
QString errorString; \
QTextStream qts(&errorString); \
qts << __FILE__ << ":" << __LINE__ << ": " << Y ; \
LERROR << errorString; \
throw Z(errorString); \
}

This macro writes the message Y to the error stream configured by its first parameter X, before throwing a Z exception (Z is an exception class name) with the same message.

Definition at line 332 of file LimaCommon.h.

◆ LIMA_FSAACCESS_EXPORT

#define LIMA_FSAACCESS_EXPORT

Definition at line 130 of file LimaCommon.h.

◆ LIMA_MEDIAPROCESSORS_EXPORT

#define LIMA_MEDIAPROCESSORS_EXPORT

Definition at line 131 of file LimaCommon.h.

◆ LIMA_MEDIATICDATA_EXPORT

#define LIMA_MEDIATICDATA_EXPORT

Definition at line 132 of file LimaCommon.h.

◆ LIMA_PROCESSUNITFRAMEWORK_EXPORT

#define LIMA_PROCESSUNITFRAMEWORK_EXPORT

Definition at line 135 of file LimaCommon.h.

◆ LIMA_TIME_EXPORT

#define LIMA_TIME_EXPORT

Definition at line 136 of file LimaCommon.h.

◆ LIMA_UNUSED

#define LIMA_UNUSED (   x)    (void)x;

Definition at line 224 of file LimaCommon.h.

◆ LIMA_XMLCONFIGURATIONFILES_EXPORT

#define LIMA_XMLCONFIGURATIONFILES_EXPORT

Definition at line 137 of file LimaCommon.h.

◆ LINFO

#define LINFO   QLOG_INFO()

Definition at line 158 of file LimaCommon.h.

◆ LNOTICE

#define LNOTICE   QLOG_INFO()

Definition at line 159 of file LimaCommon.h.

◆ LOGINIT

#define LOGINIT (   X)
Value:
static LogInit logInit(X); /*initialisation exécutée une seul fois*/\
auto& logger = *(logInit.pLogger); \
logger.setLoggingLevel(QsLogging::Categories::instance().levelFor( X ));
static Categories & instance()
Level levelFor(const QString &category) const

Definition at line 187 of file LimaCommon.h.

◆ LTRACE

#define LTRACE   QLOG_TRACE()

Definition at line 156 of file LimaCommon.h.

◆ LWARN

#define LWARN   QLOG_WARN()

Definition at line 160 of file LimaCommon.h.

◆ MDATALOGINIT

#define MDATALOGINIT   LOGINIT("Common::MediaticData")

Definition at line 209 of file LimaCommon.h.

◆ MISCLOGINIT

#define MISCLOGINIT   LOGINIT("Common::Misc")

Definition at line 210 of file LimaCommon.h.

◆ PROCESSORSLOGINIT

#define PROCESSORSLOGINIT   LOGINIT("Common::Processors")

Definition at line 211 of file LimaCommon.h.

◆ PROCESSUNITFRAMEWORKLOGINIT

#define PROCESSUNITFRAMEWORKLOGINIT   LOGINIT("Common::ProcessUnitFramework")

Definition at line 212 of file LimaCommon.h.

◆ PROPERTYCODELOGINIT

#define PROPERTYCODELOGINIT   LOGINIT("Common::PropertyCode")

Definition at line 213 of file LimaCommon.h.

◆ QTENDL

#define QTENDL   Qt::endl

Definition at line 32 of file LimaCommon.h.

◆ STRINGMAPLOGINIT

#define STRINGMAPLOGINIT   LOGINIT("Common::StringMap")

Definition at line 214 of file LimaCommon.h.

◆ STRPOOLLOGINIT

#define STRPOOLLOGINIT   LOGINIT("Common::StringPool")

Definition at line 215 of file LimaCommon.h.

◆ TGVLOGINIT

#define TGVLOGINIT   LOGINIT("Common::TGV")

Definition at line 216 of file LimaCommon.h.

◆ UNDEFLANG

#define UNDEFLANG   static_cast<Lima::MediaId>(std::numeric_limits<uint8_t>::max())

Definition at line 252 of file LimaCommon.h.

◆ USE_STD_BITSET_FOR_LINGUISTIC_CODE

#define USE_STD_BITSET_FOR_LINGUISTIC_CODE

Definition at line 227 of file LimaCommon.h.

◆ XMLCFGLOGINIT

#define XMLCFGLOGINIT   LOGINIT("Common::XMLConfigurationFiles")

Definition at line 217 of file LimaCommon.h.

Function Documentation

◆ operator<<()

QDebug & operator<< ( QDebug &  qd,
const std::string &  str 
)

Definition at line 39 of file QsLog.cpp.