LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Lima::AnalysisContent Class Reference

Holds all data that pass through the ProcessUnits Analysis data are shared pointers, simplifying memory management. More...

#include <common/ProcessUnitFramework/AnalysisContent.h>

Public Member Functions

 AnalysisContent ()
 
 AnalysisContent (const AnalysisContent &)=delete
 
AnalysisContent & operator= (const AnalysisContent &)=delete
 
virtual ~AnalysisContent ()
 Reduce the reference count of all AnalysisData in AnalysisContent causing them to be deleted if needed.
 
std::shared_ptr< AnalysisData > getData (const QString &id)
 return AnalysisData by id
 
const std::shared_ptr< AnalysisData > getData (const QString &id) const
 return constant AnalysisData by id
 
void setData (const QString &id, std::shared_ptr< AnalysisData > data)
 set an analysisData with the given id.
 
void setData (const QString &id, AnalysisData *data)
 set an analysisData with the given id.
 
void removeData (const QString &id)
 remove the analysisData with the given id
 
std::shared_ptr< AnalysisData > getData (const std::string &id)
 return AnalysisData by id
 
std::shared_ptr< AnalysisData > getData (const char *id)
 return AnalysisData by id
 
const std::shared_ptr< AnalysisData > getData (const std::string &id) const
 return constant AnalysisData by id
 
const std::shared_ptr< AnalysisData > getData (const char *id) const
 return constant AnalysisData by id
 
void setData (const std::string &id, std::shared_ptr< AnalysisData > data)
 set an analysisData with the given id.
 
void setData (const char *id, std::shared_ptr< AnalysisData > data)
 set an analysisData with the given id.
 
void setData (const std::string &id, AnalysisData *data)
 set an analysisData with the given id.
 
void setData (const char *id, AnalysisData *data)
 set an analysisData with the given id.
 
void removeData (const char *id)
 remove the analysisData with the given id
 
void removeData (const std::string &id)
 remove the analysisData with the given id
 
void clear ()
 remove all the analysisData
 
void releaseData (const std::string &id)
 remove the analysisData with the given id without destructing it
 

Detailed Description

Holds all data that pass through the ProcessUnits Analysis data are shared pointers, simplifying memory management.

Definition at line 36 of file AnalysisContent.h.

Constructor & Destructor Documentation

◆ AnalysisContent() [1/2]

Lima::AnalysisContent::AnalysisContent ( )

Definition at line 30 of file AnalysisContent.cpp.

◆ AnalysisContent() [2/2]

Lima::AnalysisContent::AnalysisContent ( const AnalysisContent &  )
delete

◆ ~AnalysisContent()

Lima::AnalysisContent::~AnalysisContent ( )
virtual

Reduce the reference count of all AnalysisData in AnalysisContent causing them to be deleted if needed.

Returns

Definition at line 34 of file AnalysisContent.cpp.

Member Function Documentation

◆ clear()

void Lima::AnalysisContent::clear ( )

remove all the analysisData

◆ getData() [1/6]

std::shared_ptr< AnalysisData > Lima::AnalysisContent::getData ( const char *  id)

return AnalysisData by id

Parameters
idId of analysis to return
Returns
std::shared_ptr< AnalysisData >
Return values
sharedpointer to valid AnalysisData if exists
emptyshared pointer if specified AnalysisData doesn't exists

Definition at line 109 of file AnalysisContent.cpp.

◆ getData() [2/6]

const std::shared_ptr< AnalysisData > Lima::AnalysisContent::getData ( const char *  id) const

return constant AnalysisData by id

Parameters
idId of analysis to return
Returns
std::shared_ptr< AnalysisData >
Return values
sharedpointer to valid AnalysisData if exists
emptyshared pointer if specified AnalysisData doesn't exists

Definition at line 114 of file AnalysisContent.cpp.

◆ getData() [3/6]

std::shared_ptr< AnalysisData > Lima::AnalysisContent::getData ( const QString &  id)

return AnalysisData by id

Parameters
idId of analysis to return
Returns
std::shared_ptr< AnalysisData >
Return values
sharedpointer to valid AnalysisData if exists
emptyshared pointer if specified AnalysisData doesn't exists

Definition at line 39 of file AnalysisContent.cpp.

◆ getData() [4/6]

const std::shared_ptr< AnalysisData > Lima::AnalysisContent::getData ( const QString &  id) const

return constant AnalysisData by id

Parameters
idId of analysis to return
Returns
std::shared_ptr< AnalysisData >
Return values
sharedpointer to valid AnalysisData if exists
emptyshared pointer if specified AnalysisData doesn't exists

Definition at line 53 of file AnalysisContent.cpp.

◆ getData() [5/6]

std::shared_ptr< AnalysisData > Lima::AnalysisContent::getData ( const std::string &  id)

return AnalysisData by id

Deprecated:
Use the QString-based API instead
Parameters
idId of analysis to return
Returns
std::shared_ptr< AnalysisData >
Return values
sharedpointer to valid AnalysisData if exists
emptyshared pointer if specified AnalysisData doesn't exists

Definition at line 104 of file AnalysisContent.cpp.

◆ getData() [6/6]

const std::shared_ptr< AnalysisData > Lima::AnalysisContent::getData ( const std::string &  id) const

return constant AnalysisData by id

Deprecated:
Use the QString-based API instead
Parameters
idId of analysis to return
Returns
std::shared_ptr< AnalysisData >
Return values
sharedpointer to valid AnalysisData if exists
emptyshared pointer if specified AnalysisData doesn't exists

Definition at line 119 of file AnalysisContent.cpp.

◆ operator=()

AnalysisContent & Lima::AnalysisContent::operator= ( const AnalysisContent &  )
delete

◆ releaseData()

void Lima::AnalysisContent::releaseData ( const std::string &  id)

remove the analysisData with the given id without destructing it

Deprecated:
This was useful when data was raw pointers to transfer ownership. Now that data are shared_pointers, the reference counting mechanism handles the destruction when necessary.
Parameters
idthe identifier of the AnalysisData to release

Definition at line 154 of file AnalysisContent.cpp.

◆ removeData() [1/3]

void Lima::AnalysisContent::removeData ( const char *  id)

remove the analysisData with the given id

Parameters
idthe identifier of the AnalysisData to remove

Definition at line 149 of file AnalysisContent.cpp.

◆ removeData() [2/3]

void Lima::AnalysisContent::removeData ( const QString &  id)

remove the analysisData with the given id

Parameters
idthe identifier of the AnalysisData to remove

Definition at line 91 of file AnalysisContent.cpp.

◆ removeData() [3/3]

void Lima::AnalysisContent::removeData ( const std::string &  id)

remove the analysisData with the given id

Deprecated:
Use the QString-based API instead
Parameters
idthe identifier of the AnalysisData to remove

Definition at line 144 of file AnalysisContent.cpp.

◆ setData() [1/6]

void Lima::AnalysisContent::setData ( const char *  id,
AnalysisData *  data 
)

set an analysisData with the given id.

Take ownership of the pointer.

Deprecated:
Use the shared_ptr-based API instead
Parameters
idId to design the given analysisData
dataAnalysisData to store. Take ownership of the pointer.

Definition at line 139 of file AnalysisContent.cpp.

◆ setData() [2/6]

void Lima::AnalysisContent::setData ( const char *  id,
std::shared_ptr< AnalysisData >  data 
)

set an analysisData with the given id.

Parameters
idId to design the given analysisData
dataAnalysisData to store.

Definition at line 134 of file AnalysisContent.cpp.

◆ setData() [3/6]

void Lima::AnalysisContent::setData ( const QString &  id,
AnalysisData *  data 
)

set an analysisData with the given id.

Take ownership of the pointer.

Deprecated:
Use the shared_ptr-based API instead
Parameters
idId to design the given analysisData
dataAnalysisData to store. Take ownership of the pointer.

Definition at line 82 of file AnalysisContent.cpp.

◆ setData() [4/6]

void Lima::AnalysisContent::setData ( const QString &  id,
std::shared_ptr< AnalysisData >  data 
)

set an analysisData with the given id.

Parameters
idId to design the given analysisData
dataAnalysisData to store.

Definition at line 67 of file AnalysisContent.cpp.

◆ setData() [5/6]

void Lima::AnalysisContent::setData ( const std::string &  id,
AnalysisData *  data 
)

set an analysisData with the given id.

Take ownership of the pointer.

Deprecated:

Use the QString-based API instead

Use the shared_ptr-based API instead

Parameters
idId to design the given analysisData
dataAnalysisData to store. Take ownership of the pointer.

Definition at line 129 of file AnalysisContent.cpp.

◆ setData() [6/6]

void Lima::AnalysisContent::setData ( const std::string &  id,
std::shared_ptr< AnalysisData >  data 
)

set an analysisData with the given id.

Deprecated:
Use the QString-based API instead
Parameters
idId to design the given analysisData
dataAnalysisData to store.

Definition at line 124 of file AnalysisContent.cpp.


The documentation for this class was generated from the following files: