[DEV] update etk null
This commit is contained in:
parent
f0e1d48838
commit
14a490222f
@ -37,8 +37,8 @@ appl::InterfaceInput::InterfaceInput(std11::shared_ptr<audio::river::Manager> _m
|
|||||||
audio::format_int16,
|
audio::format_int16,
|
||||||
_input);
|
_input);
|
||||||
}
|
}
|
||||||
if(m_interface == nullptr) {
|
if(m_interface == null) {
|
||||||
APPL_ERROR("nullptr interface");
|
APPL_ERROR("null interface");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// set callback mode ...
|
// set callback mode ...
|
||||||
@ -53,8 +53,8 @@ appl::InterfaceInput::InterfaceInput(std11::shared_ptr<audio::river::Manager> _m
|
|||||||
m_interface->start();
|
m_interface->start();
|
||||||
}
|
}
|
||||||
appl::InterfaceInput::~InterfaceInput() {
|
appl::InterfaceInput::~InterfaceInput() {
|
||||||
if(m_interface == nullptr) {
|
if(m_interface == null) {
|
||||||
APPL_ERROR("nullptr interface");
|
APPL_ERROR("null interface");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_interface->stop();
|
m_interface->stop();
|
||||||
|
@ -26,7 +26,7 @@ appl::InterfaceOutput::~InterfaceOutput() {
|
|||||||
void appl::InterfaceOutput::onTopicMessage(const audio_msg::AudioBuffer::ConstPtr& _msg) {
|
void appl::InterfaceOutput::onTopicMessage(const audio_msg::AudioBuffer::ConstPtr& _msg) {
|
||||||
std11::unique_lock<ethread::Mutex> lock(m_mutex);
|
std11::unique_lock<ethread::Mutex> lock(m_mutex);
|
||||||
for (size_t iii=0; iii<m_list.size(); ++iii) {
|
for (size_t iii=0; iii<m_list.size(); ++iii) {
|
||||||
if (m_list[iii] == nullptr) {
|
if (m_list[iii] == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (m_list[iii]->getName() == _msg->sourceName) {
|
if (m_list[iii]->getName() == _msg->sourceName) {
|
||||||
@ -37,7 +37,7 @@ void appl::InterfaceOutput::onTopicMessage(const audio_msg::AudioBuffer::ConstPt
|
|||||||
}
|
}
|
||||||
// new interface name:
|
// new interface name:
|
||||||
std11::shared_ptr<appl::InterfaceOutputManager> newInterface = std11::make_shared<appl::InterfaceOutputManager>(_msg->sourceName);
|
std11::shared_ptr<appl::InterfaceOutputManager> newInterface = std11::make_shared<appl::InterfaceOutputManager>(_msg->sourceName);
|
||||||
if (newInterface == nullptr) {
|
if (newInterface == null) {
|
||||||
APPL_ERROR("can not generate new interface element...");
|
APPL_ERROR("can not generate new interface element...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@ void appl::InterfaceOutput::onTimer(const ros::TimerEvent& _timer) {
|
|||||||
std11::unique_lock<ethread::Mutex> lock(m_mutex);
|
std11::unique_lock<ethread::Mutex> lock(m_mutex);
|
||||||
etk::Vector<std11::shared_ptr<appl::InterfaceOutputManager> >::iterator it = m_list.begin();
|
etk::Vector<std11::shared_ptr<appl::InterfaceOutputManager> >::iterator it = m_list.begin();
|
||||||
while (it != m_list.end()) {
|
while (it != m_list.end()) {
|
||||||
if (*it == nullptr) {
|
if (*it == null) {
|
||||||
it = m_list.erase(it);
|
it = m_list.erase(it);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ appl::InterfaceOutputElement::~InterfaceOutputElement() {
|
|||||||
|
|
||||||
void appl::InterfaceOutputElement::onTopicMessage(const etk::String& _streamName, const audio_msg::AudioBuffer::ConstPtr& _msg) {
|
void appl::InterfaceOutputElement::onTopicMessage(const etk::String& _streamName, const audio_msg::AudioBuffer::ConstPtr& _msg) {
|
||||||
std11::unique_lock<ethread::Mutex> lock(m_mutex);
|
std11::unique_lock<ethread::Mutex> lock(m_mutex);
|
||||||
if (m_interface != nullptr) {
|
if (m_interface != null) {
|
||||||
APPL_VERBOSE("Write data : " << m_id << " size= " << _msg->data.size()/m_interface->getInterfaceFormat().getChunkSize());
|
APPL_VERBOSE("Write data : " << m_id << " size= " << _msg->data.size()/m_interface->getInterfaceFormat().getChunkSize());
|
||||||
m_interface->write(&_msg->data[0], _msg->data.size()/m_interface->getInterfaceFormat().getChunkSize());
|
m_interface->write(&_msg->data[0], _msg->data.size()/m_interface->getInterfaceFormat().getChunkSize());
|
||||||
m_nbConsecutiveUnderflow = 0;
|
m_nbConsecutiveUnderflow = 0;
|
||||||
@ -40,8 +40,8 @@ void appl::InterfaceOutputElement::onTopicMessage(const etk::String& _streamName
|
|||||||
map,
|
map,
|
||||||
format,
|
format,
|
||||||
_streamName);
|
_streamName);
|
||||||
if(m_interface == nullptr) {
|
if(m_interface == null) {
|
||||||
APPL_ERROR("nullptr interface");
|
APPL_ERROR("null interface");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_interface->setReadwrite();
|
m_interface->setReadwrite();
|
||||||
|
@ -27,7 +27,7 @@ appl::InterfaceOutputManager::~InterfaceOutputManager() {
|
|||||||
void appl::InterfaceOutputManager::onTopicMessage(const etk::String& _streamName, const audio_msg::AudioBuffer::ConstPtr& _msg) {
|
void appl::InterfaceOutputManager::onTopicMessage(const etk::String& _streamName, const audio_msg::AudioBuffer::ConstPtr& _msg) {
|
||||||
std11::unique_lock<ethread::Mutex> lock(m_mutex);
|
std11::unique_lock<ethread::Mutex> lock(m_mutex);
|
||||||
for (size_t iii=0; iii<m_elementList.size(); ++iii) {
|
for (size_t iii=0; iii<m_elementList.size(); ++iii) {
|
||||||
if (m_elementList[iii] == nullptr) {
|
if (m_elementList[iii] == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(m_elementList[iii]->getId() == _msg->sourceId) {
|
if(m_elementList[iii]->getId() == _msg->sourceId) {
|
||||||
@ -37,8 +37,8 @@ void appl::InterfaceOutputManager::onTopicMessage(const etk::String& _streamName
|
|||||||
}
|
}
|
||||||
// no interface found => create a new one
|
// no interface found => create a new one
|
||||||
std11::shared_ptr<appl::InterfaceOutputElement> interface = std11::make_shared<appl::InterfaceOutputElement>(m_manager, _msg->sourceId);
|
std11::shared_ptr<appl::InterfaceOutputElement> interface = std11::make_shared<appl::InterfaceOutputElement>(m_manager, _msg->sourceId);
|
||||||
if(interface == nullptr) {
|
if(interface == null) {
|
||||||
APPL_ERROR("nullptr interface");
|
APPL_ERROR("null interface");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_elementList.pushBack(interface);
|
m_elementList.pushBack(interface);
|
||||||
@ -50,7 +50,7 @@ bool appl::InterfaceOutputManager::onTimer() {
|
|||||||
etk::Vector<std11::shared_ptr<appl::InterfaceOutputElement> >::iterator it = m_elementList.begin();
|
etk::Vector<std11::shared_ptr<appl::InterfaceOutputElement> >::iterator it = m_elementList.begin();
|
||||||
bool oneElementRemoved = false;
|
bool oneElementRemoved = false;
|
||||||
while (it != m_elementList.end()) {
|
while (it != m_elementList.end()) {
|
||||||
if (*it == nullptr) {
|
if (*it == null) {
|
||||||
it = m_elementList.erase(it);
|
it = m_elementList.erase(it);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ bool f_create(audio_core::create::Request& _req,
|
|||||||
audio::convertFormat(_req.channelFormat),
|
audio::convertFormat(_req.channelFormat),
|
||||||
_req.frequency,
|
_req.frequency,
|
||||||
audio::convertChannel(_req.channelMap));
|
audio::convertChannel(_req.channelMap));
|
||||||
if (newInterface == nullptr) {
|
if (newInterface == null) {
|
||||||
_res.handle = -1;
|
_res.handle = -1;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ bool f_remove(audio_core::remove::Request& _req,
|
|||||||
std11::shared_ptr<appl::InterfaceOutput> interface;
|
std11::shared_ptr<appl::InterfaceOutput> interface;
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
for(size_t iii=0; iii<g_listInterafceOut.size(); ++iii) {
|
for(size_t iii=0; iii<g_listInterafceOut.size(); ++iii) {
|
||||||
if (g_listInterafceOut[iii] == nullptr) {
|
if (g_listInterafceOut[iii] == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (g_listInterafceOut[iii]->getId() == _req.handle) {
|
if (g_listInterafceOut[iii]->getId() == _req.handle) {
|
||||||
@ -63,7 +63,7 @@ bool f_remove(audio_core::remove::Request& _req,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
if (interface == nullptr) {
|
if (interface == null) {
|
||||||
APPL_ERROR("remove : [" << _req.handle << "] Can not remove this ==> already removed.");
|
APPL_ERROR("remove : [" << _req.handle << "] Can not remove this ==> already removed.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ bool f_getBufferTime(audio_core::getBufferTime::Request& _req,
|
|||||||
mutex.lock();
|
mutex.lock();
|
||||||
// Find the handle:
|
// Find the handle:
|
||||||
for(size_t iii=0; iii<g_listInterafceOut.size(); ++iii) {
|
for(size_t iii=0; iii<g_listInterafceOut.size(); ++iii) {
|
||||||
if (g_listInterafceOut[iii] == nullptr) {
|
if (g_listInterafceOut[iii] == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (g_listInterafceOut[iii]->getId() == _req.handle) {
|
if (g_listInterafceOut[iii]->getId() == _req.handle) {
|
||||||
@ -93,7 +93,7 @@ bool f_getBufferTime(audio_core::getBufferTime::Request& _req,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
if (interface == nullptr) {
|
if (interface == null) {
|
||||||
APPL_ERROR("getBufferTime : [" << _req.handle << "] Can not get time ==> handle does not exist...");
|
APPL_ERROR("getBufferTime : [" << _req.handle << "] Can not get time ==> handle does not exist...");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user