[DEV] uptate new lutin declaration model
This commit is contained in:
parent
2556813c9e
commit
c1220db0bd
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,3 +1,8 @@
|
|||||||
|
__pycache__
|
||||||
|
.bck
|
||||||
|
out
|
||||||
|
target
|
||||||
|
build
|
||||||
# Compiled Object files
|
# Compiled Object files
|
||||||
*.slo
|
*.slo
|
||||||
*.lo
|
*.lo
|
||||||
|
28
GLD_ememory-test.json
Normal file
28
GLD_ememory-test.json
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"type":"BINARY",
|
||||||
|
"sub-type":"TEST",
|
||||||
|
"group-id":"com.atria-soft",
|
||||||
|
"description":"e-memory test-unit",
|
||||||
|
"license":"MPL-2",
|
||||||
|
"license-file":"file://LICENCE.txt",
|
||||||
|
"maintainer":"file://authors.txt",
|
||||||
|
"author":"file://authors.txt",
|
||||||
|
"version":"file://version.txt",
|
||||||
|
"code-quality":"MEDIUM",
|
||||||
|
|
||||||
|
"source": [
|
||||||
|
"test/main.cpp",
|
||||||
|
"test/testUnique.cpp",
|
||||||
|
"test/testRef.cpp",
|
||||||
|
"test/testShared.cpp",
|
||||||
|
"test/testWeak.cpp",
|
||||||
|
"test/testEnableSharedFromThis.cpp",
|
||||||
|
"test/testCasts.cpp"
|
||||||
|
],
|
||||||
|
"dependency": [
|
||||||
|
"cxx",
|
||||||
|
"ememory",
|
||||||
|
"test-debug",
|
||||||
|
"etest"
|
||||||
|
]
|
||||||
|
}
|
44
GLD_ememory.json
Normal file
44
GLD_ememory.json
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"type":"LIBRARY",
|
||||||
|
"group-id":"com.atria-soft",
|
||||||
|
"description":"Ewol memory basic interface (have a thread safe shared_ptr with constness)",
|
||||||
|
"license":"MPL-2",
|
||||||
|
"license-file":"file://LICENCE.txt",
|
||||||
|
"maintainer":"file://authors.txt",
|
||||||
|
"author":"file://authors.txt",
|
||||||
|
"version":"file://version.txt",
|
||||||
|
"code-quality":"MEDIUM",
|
||||||
|
|
||||||
|
"source": [
|
||||||
|
"ememory/debug.cpp",
|
||||||
|
"ememory/Counter.cpp",
|
||||||
|
"ememory/RefCounter.cpp"
|
||||||
|
],
|
||||||
|
"header": [
|
||||||
|
"ememory/debug.hpp",
|
||||||
|
"ememory/memory.hpp",
|
||||||
|
"ememory/Counter.hpp",
|
||||||
|
"ememory/RefCounter.hpp",
|
||||||
|
"ememory/RefPtr.hpp",
|
||||||
|
"ememory/SharedPtr.hpp",
|
||||||
|
"ememory/UniquePtr.hpp",
|
||||||
|
"ememory/WeakPtr.hpp",
|
||||||
|
"ememory/EnableSharedFromThis.hpp",
|
||||||
|
"ememory/details/memory.hxx",
|
||||||
|
"ememory/details/SharedPtr.hxx",
|
||||||
|
"ememory/details/RefPtr.hxx",
|
||||||
|
"ememory/details/WeakPtr.hxx",
|
||||||
|
"ememory/details/EnableSharedFromThis.hxx"
|
||||||
|
],
|
||||||
|
"path":[
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"compilation-version": {
|
||||||
|
"language": "c++",
|
||||||
|
"version": 2011
|
||||||
|
},
|
||||||
|
"dependency": [
|
||||||
|
"etk-core",
|
||||||
|
"elog"
|
||||||
|
]
|
||||||
|
}
|
@ -39,6 +39,12 @@ void ememory::RefCounter::refKeep() {
|
|||||||
void ememory::RefCounter::refRelease() {
|
void ememory::RefCounter::refRelease() {
|
||||||
int refCount = --m_refCount;
|
int refCount = --m_refCount;
|
||||||
if (refCount == 0) {
|
if (refCount == 0) {
|
||||||
|
m_refCount++;
|
||||||
|
destroyRequested();
|
||||||
|
refCount = --m_refCount;
|
||||||
|
if (refCount != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// No more element ==> remove it.
|
// No more element ==> remove it.
|
||||||
this->~RefCounter();
|
this->~RefCounter();
|
||||||
ETK_DELETE(ememory::RefCounter, this);
|
ETK_DELETE(ememory::RefCounter, this);
|
||||||
|
@ -50,11 +50,20 @@ namespace ememory {
|
|||||||
* @return Request const SharedPtr
|
* @return Request const SharedPtr
|
||||||
*/
|
*/
|
||||||
//const ememory::RefPtr<EMEMORY_TYPE> refFromThis() const;
|
//const ememory::RefPtr<EMEMORY_TYPE> refFromThis() const;
|
||||||
|
#ifdef DEBUG
|
||||||
|
int32_t getUid() const {
|
||||||
|
return m_uid;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* @brief get the RAW pointer value of this element (for debug only)
|
* @brief get the RAW pointer value of this element (for debug only)
|
||||||
*/
|
*/
|
||||||
uint64_t getRawPointer() const;
|
uint64_t getRawPointer() const;
|
||||||
|
/**
|
||||||
|
* @brief Call befor destroy the object.
|
||||||
|
*/
|
||||||
|
virtual void destroyRequested() {}
|
||||||
};
|
};
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
void resetDebugRefCounter();
|
void resetDebugRefCounter();
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
import realog.debug as debug
|
|
||||||
import lutin.tools as tools
|
|
||||||
|
|
||||||
|
|
||||||
def get_type():
|
|
||||||
return "BINARY"
|
|
||||||
|
|
||||||
def get_sub_type():
|
|
||||||
return "TEST"
|
|
||||||
|
|
||||||
def get_desc():
|
|
||||||
return "e-memory test-unit"
|
|
||||||
|
|
||||||
def get_licence():
|
|
||||||
return "MPL-2"
|
|
||||||
|
|
||||||
def get_compagny_type():
|
|
||||||
return "com"
|
|
||||||
|
|
||||||
def get_compagny_name():
|
|
||||||
return "atria-soft"
|
|
||||||
|
|
||||||
def get_maintainer():
|
|
||||||
return "authors.txt"
|
|
||||||
|
|
||||||
def configure(target, my_module):
|
|
||||||
my_module.add_src_file([
|
|
||||||
'test/main.cpp',
|
|
||||||
'test/testUnique.cpp',
|
|
||||||
'test/testRef.cpp',
|
|
||||||
'test/testShared.cpp',
|
|
||||||
'test/testWeak.cpp',
|
|
||||||
'test/testEnableSharedFromThis.cpp',
|
|
||||||
'test/testCasts.cpp'
|
|
||||||
])
|
|
||||||
my_module.add_depend([
|
|
||||||
'cxx',
|
|
||||||
'ememory',
|
|
||||||
'test-debug',
|
|
||||||
'etest',
|
|
||||||
])
|
|
||||||
return True
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
import realog.debug as debug
|
|
||||||
import lutin.tools as tools
|
|
||||||
|
|
||||||
|
|
||||||
def get_type():
|
|
||||||
return "LIBRARY"
|
|
||||||
|
|
||||||
def get_desc():
|
|
||||||
return "Ewol memory basic interface (have a thread safe shared_ptr with constness)"
|
|
||||||
|
|
||||||
def get_licence():
|
|
||||||
return "MPL-2"
|
|
||||||
|
|
||||||
def get_compagny_type():
|
|
||||||
return "com"
|
|
||||||
|
|
||||||
def get_compagny_name():
|
|
||||||
return "atria-soft"
|
|
||||||
|
|
||||||
def get_maintainer():
|
|
||||||
return "authors.txt"
|
|
||||||
|
|
||||||
def get_version():
|
|
||||||
return "version.txt"
|
|
||||||
|
|
||||||
def configure(target, my_module):
|
|
||||||
my_module.add_extra_flags()
|
|
||||||
# add the file to compile:
|
|
||||||
my_module.add_src_file([
|
|
||||||
'ememory/debug.cpp',
|
|
||||||
'ememory/Counter.cpp',
|
|
||||||
'ememory/RefCounter.cpp',
|
|
||||||
])
|
|
||||||
|
|
||||||
my_module.add_header_file([
|
|
||||||
'ememory/debug.hpp',
|
|
||||||
'ememory/memory.hpp',
|
|
||||||
'ememory/Counter.hpp',
|
|
||||||
'ememory/RefCounter.hpp',
|
|
||||||
'ememory/RefPtr.hpp',
|
|
||||||
'ememory/SharedPtr.hpp',
|
|
||||||
'ememory/UniquePtr.hpp',
|
|
||||||
'ememory/WeakPtr.hpp',
|
|
||||||
'ememory/EnableSharedFromThis.hpp',
|
|
||||||
'ememory/details/memory.hxx',
|
|
||||||
'ememory/details/SharedPtr.hxx',
|
|
||||||
'ememory/details/RefPtr.hxx',
|
|
||||||
'ememory/details/WeakPtr.hxx',
|
|
||||||
'ememory/details/EnableSharedFromThis.hxx',
|
|
||||||
])
|
|
||||||
|
|
||||||
# build in C++ mode
|
|
||||||
my_module.compile_version("c++", 2011)
|
|
||||||
# add dependency of the generic C++ library:
|
|
||||||
my_module.add_depend('etk-core')
|
|
||||||
my_module.add_optionnal_depend('elog')
|
|
||||||
|
|
||||||
my_module.add_path(".")
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user