[DEV] change ewol::signal::List in ewol::signal::Interface
This commit is contained in:
parent
61afe48646
commit
ec3c7b2902
2
external/ege
vendored
2
external/ege
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 343021de91b1662da5dafe9ae9b6a089bb5edcfc
|
Subproject commit 6adec3434ea382c94554f5d8fac3b60573eae382
|
@ -17,7 +17,7 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
class Context;
|
class Context;
|
||||||
namespace object {
|
namespace object {
|
||||||
class Manager : public ewol::signal::List {
|
class Manager : public ewol::signal::Interface {
|
||||||
private:
|
private:
|
||||||
std::vector<std::weak_ptr<ewol::Object>> m_eObjectList; // all widget allocated == > all time increment ... never removed ...
|
std::vector<std::weak_ptr<ewol::Object>> m_eObjectList; // all widget allocated == > all time increment ... never removed ...
|
||||||
Context& m_context;
|
Context& m_context;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <ewol/parameter/Value.h>
|
#include <ewol/parameter/Value.h>
|
||||||
#include <ewol/parameter/Range.h>
|
#include <ewol/parameter/Range.h>
|
||||||
#include <ewol/parameter/List.h>
|
#include <ewol/parameter/List.h>
|
||||||
#include <ewol/signal/List.h>
|
#include <ewol/signal/Interface.h>
|
||||||
|
|
||||||
namespace ewol {
|
namespace ewol {
|
||||||
// some class need to define element befor other ...
|
// some class need to define element befor other ...
|
||||||
@ -52,7 +52,7 @@ namespace ewol {
|
|||||||
*/
|
*/
|
||||||
class Object : public std::enable_shared_from_this<Object>,
|
class Object : public std::enable_shared_from_this<Object>,
|
||||||
public ewol::parameter::Interface,
|
public ewol::parameter::Interface,
|
||||||
public ewol::signal::List {
|
public ewol::signal::Interface {
|
||||||
private:
|
private:
|
||||||
static size_t m_valUID; //!< Static used for the unique ID definition
|
static size_t m_valUID; //!< Static used for the unique ID definition
|
||||||
private:
|
private:
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <ewol/debug.h>
|
#include <ewol/debug.h>
|
||||||
#include <ewol/signal/List.h>
|
#include <ewol/signal/Interface.h>
|
||||||
#include <ewol/signal/Base.h>
|
#include <ewol/signal/Base.h>
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -16,16 +16,16 @@
|
|||||||
int32_t ewol::signal::Base::m_signalCallLevel = 0;
|
int32_t ewol::signal::Base::m_signalCallLevel = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ewol::signal::Base::Base(ewol::signal::List& _signalLink,
|
ewol::signal::Base::Base(ewol::signal::Interface& _signalInterfaceLink,
|
||||||
const std::string& _name,
|
const std::string& _name,
|
||||||
const std::string& _description) :
|
const std::string& _description) :
|
||||||
m_signalLink(_signalLink),
|
m_signalInterfaceLink(_signalInterfaceLink),
|
||||||
m_name(_name),
|
m_name(_name),
|
||||||
m_description(_description),
|
m_description(_description),
|
||||||
m_callInProgress(0),
|
m_callInProgress(0),
|
||||||
m_someOneRemoveInCall(false) {
|
m_someOneRemoveInCall(false) {
|
||||||
// add a reference on the current signal ...
|
// add a reference on the current signal ...
|
||||||
m_signalLink.signalAdd(this);
|
m_signalInterfaceLink.signalAdd(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& ewol::signal::operator <<(std::ostream& _os, const ewol::signal::Base& _obj) {
|
std::ostream& ewol::signal::operator <<(std::ostream& _os, const ewol::signal::Base& _obj) {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#ifndef __EWOL_SIGNAL_BASE_H__
|
#ifndef __EWOL_SIGNAL_BASE_H__
|
||||||
#define __EWOL_SIGNAL_BASE_H__
|
#define __EWOL_SIGNAL_BASE_H__
|
||||||
|
|
||||||
#include <ewol/signal/List.h>
|
#include <ewol/signal/Interface.h>
|
||||||
|
|
||||||
|
|
||||||
namespace ewol {
|
namespace ewol {
|
||||||
@ -20,7 +20,7 @@ namespace ewol {
|
|||||||
static int32_t m_uidSignal;
|
static int32_t m_uidSignal;
|
||||||
static int32_t m_signalCallLevel;
|
static int32_t m_signalCallLevel;
|
||||||
#endif
|
#endif
|
||||||
ewol::signal::List& m_signalLink;
|
ewol::signal::Interface& m_signalInterfaceLink;
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
std::string m_description;
|
std::string m_description;
|
||||||
int32_t m_callInProgress;
|
int32_t m_callInProgress;
|
||||||
@ -28,11 +28,11 @@ namespace ewol {
|
|||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Create a parameter with a specific type.
|
* @brief Create a parameter with a specific type.
|
||||||
* @param[in] _signalListLink reference on the signal list.
|
* @param[in] _signalInterfaceLink reference on the signal list.
|
||||||
* @param[in] _name Static name of the parameter.
|
* @param[in] _name Static name of the parameter.
|
||||||
* @param[in] _description description of the parameter.
|
* @param[in] _description description of the parameter.
|
||||||
*/
|
*/
|
||||||
Base(ewol::signal::List& _signalListLink,
|
Base(ewol::signal::Interface& _signalInterfaceLink,
|
||||||
const std::string& _name,
|
const std::string& _name,
|
||||||
const std::string& _description = "");
|
const std::string& _description = "");
|
||||||
/**
|
/**
|
||||||
|
@ -8,19 +8,19 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <ewol/debug.h>
|
#include <ewol/debug.h>
|
||||||
#include <ewol/signal/List.h>
|
#include <ewol/signal/Interface.h>
|
||||||
#include <ewol/signal/Base.h>
|
#include <ewol/signal/Base.h>
|
||||||
|
|
||||||
ewol::signal::List::List() {
|
ewol::signal::Interface::Interface() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ewol::signal::List::~List() {
|
ewol::signal::Interface::~Interface() {
|
||||||
m_list.clear();
|
m_list.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// note this pointer is not allocated and not free at the end of the class
|
// note this pointer is not allocated and not free at the end of the class
|
||||||
void ewol::signal::List::signalAdd(ewol::signal::Base* _pointerOnSignal) {
|
void ewol::signal::Interface::signalAdd(ewol::signal::Base* _pointerOnSignal) {
|
||||||
if (_pointerOnSignal == nullptr) {
|
if (_pointerOnSignal == nullptr) {
|
||||||
EWOL_ERROR("Try to link a nullptr parameters");
|
EWOL_ERROR("Try to link a nullptr parameters");
|
||||||
return;
|
return;
|
||||||
@ -28,7 +28,7 @@ void ewol::signal::List::signalAdd(ewol::signal::Base* _pointerOnSignal) {
|
|||||||
m_list.push_back(_pointerOnSignal);
|
m_list.push_back(_pointerOnSignal);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> ewol::signal::List::signalGetAll() const {
|
std::vector<std::string> ewol::signal::Interface::signalGetAll() const {
|
||||||
std::vector<std::string> out;
|
std::vector<std::string> out;
|
||||||
for (auto &it : m_list) {
|
for (auto &it : m_list) {
|
||||||
if(it != nullptr) {
|
if(it != nullptr) {
|
||||||
@ -38,7 +38,7 @@ std::vector<std::string> ewol::signal::List::signalGetAll() const {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::signal::List::signalUnBindAll(const std::shared_ptr<void>& _object) {
|
void ewol::signal::Interface::signalUnBindAll(const std::shared_ptr<void>& _object) {
|
||||||
if (_object == nullptr) {
|
if (_object == nullptr) {
|
||||||
EWOL_ERROR("Input ERROR nullptr pointer Object ...");
|
EWOL_ERROR("Input ERROR nullptr pointer Object ...");
|
||||||
return;
|
return;
|
@ -7,8 +7,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef __EWOL_SIGNAL_LIST_H__
|
#ifndef __EWOL_SIGNAL_INTERFACE_H__
|
||||||
#define __EWOL_SIGNAL_LIST_H__
|
#define __EWOL_SIGNAL_INTERFACE_H__
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace signal {
|
namespace signal {
|
||||||
class Base;
|
class Base;
|
||||||
class List {
|
class Interface {
|
||||||
friend class ewol::signal::Base; // to register parameter in the list.
|
friend class ewol::signal::Base; // to register parameter in the list.
|
||||||
private:
|
private:
|
||||||
std::vector<ewol::signal::Base*> m_list; //!< list of availlable Parameters
|
std::vector<ewol::signal::Base*> m_list; //!< list of availlable Parameters
|
||||||
@ -24,11 +24,11 @@ namespace ewol {
|
|||||||
/**
|
/**
|
||||||
* @brief Constructor.
|
* @brief Constructor.
|
||||||
*/
|
*/
|
||||||
List();
|
Interface();
|
||||||
/**
|
/**
|
||||||
* @brief Destructor.
|
* @brief Destructor.
|
||||||
*/
|
*/
|
||||||
~List();
|
~Interface();
|
||||||
/**
|
/**
|
||||||
* @brief Register a parameter class pointer in the List of parameters
|
* @brief Register a parameter class pointer in the List of parameters
|
||||||
* @note This class does not destroy the parameter pointer!!!
|
* @note This class does not destroy the parameter pointer!!!
|
@ -24,17 +24,17 @@ namespace ewol {
|
|||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Create a parameter with a specific type.
|
* @brief Create a parameter with a specific type.
|
||||||
* @param[in] _objectLink reference on the parameter lister.
|
* @param[in] _signalInterfaceLink reference on the parameter lister.
|
||||||
* @param[in] _name Static name of the parameter.
|
* @param[in] _name Static name of the parameter.
|
||||||
* @param[in] _defaultValue Default value of the parameter.
|
* @param[in] _defaultValue Default value of the parameter.
|
||||||
* @param[in] _min Minumum value.
|
* @param[in] _min Minumum value.
|
||||||
* @param[in] _max Maximum value.
|
* @param[in] _max Maximum value.
|
||||||
* @param[in] _description description of the parameter.
|
* @param[in] _description description of the parameter.
|
||||||
*/
|
*/
|
||||||
Signal(ewol::signal::List& _objectLink,
|
Signal(ewol::signal::Interface& _signalInterfaceLink,
|
||||||
const std::string& _name,
|
const std::string& _name,
|
||||||
const std::string& _description = "") :
|
const std::string& _description = "") :
|
||||||
signal::Base(_objectLink, _name, _description) {
|
signal::Base(_signalInterfaceLink, _name, _description) {
|
||||||
|
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
@ -171,17 +171,17 @@ namespace ewol {
|
|||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Create a parameter with a specific type.
|
* @brief Create a parameter with a specific type.
|
||||||
* @param[in] _objectLink reference on the parameter lister.
|
* @param[in] _signalInterfaceLink reference on the parameter lister.
|
||||||
* @param[in] _name Static name of the parameter.
|
* @param[in] _name Static name of the parameter.
|
||||||
* @param[in] _defaultValue Default value of the parameter.
|
* @param[in] _defaultValue Default value of the parameter.
|
||||||
* @param[in] _min Minumum value.
|
* @param[in] _min Minumum value.
|
||||||
* @param[in] _max Maximum value.
|
* @param[in] _max Maximum value.
|
||||||
* @param[in] _description description of the parameter.
|
* @param[in] _description description of the parameter.
|
||||||
*/
|
*/
|
||||||
Signal(ewol::signal::List& _objectLink,
|
Signal(ewol::signal::Interface& _signalInterfaceLink,
|
||||||
const std::string& _name,
|
const std::string& _name,
|
||||||
const std::string& _description = "") :
|
const std::string& _description = "") :
|
||||||
signal::Base(_objectLink, _name, _description) {
|
signal::Base(_signalInterfaceLink, _name, _description) {
|
||||||
|
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
@ -99,7 +99,7 @@ def create(target):
|
|||||||
])
|
])
|
||||||
# Signal :
|
# Signal :
|
||||||
myModule.add_src_file([
|
myModule.add_src_file([
|
||||||
'ewol/signal/List.cpp',
|
'ewol/signal/Interface.cpp',
|
||||||
'ewol/signal/Base.cpp'
|
'ewol/signal/Base.cpp'
|
||||||
])
|
])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user