Commit dbe5709b by Marcus Winter

fixed cpplint warnings

parent f28aa800
...@@ -96,8 +96,8 @@ class TaskWrapper { ...@@ -96,8 +96,8 @@ class TaskWrapper {
Function function, Function function,
const embb::tasks::ExecutionPolicy& policy) const embb::tasks::ExecutionPolicy& policy)
: function_(function), task_() { : function_(function), task_() {
embb::tasks::Action action(embb::base::MakeFunction(*this, &TaskWrapper::Run), embb::tasks::Action action(embb::base::MakeFunction(
policy); *this, &TaskWrapper::Run), policy);
task_ = embb::tasks::Node::GetInstance().Spawn(action); task_ = embb::tasks::Node::GetInstance().Spawn(action);
} }
......
...@@ -127,7 +127,8 @@ class Action { ...@@ -127,7 +127,8 @@ class Action {
mtapi_action_attributes_t const * attributes mtapi_action_attributes_t const * attributes
) { ) {
mtapi_status_t status; mtapi_status_t status;
handle_ = mtapi_action_create(job_id, func, node_local_data, node_local_data_size, handle_ = mtapi_action_create(job_id, func,
node_local_data, node_local_data_size,
attributes, &status); attributes, &status);
internal::CheckStatus(status); internal::CheckStatus(status);
} }
......
...@@ -40,7 +40,7 @@ namespace mtapi { ...@@ -40,7 +40,7 @@ namespace mtapi {
* \ingroup CPP_MTAPI * \ingroup CPP_MTAPI
*/ */
class ActionAttributes { class ActionAttributes {
public: public:
/** /**
* Constructs an ActionAttributes object. * Constructs an ActionAttributes object.
*/ */
...@@ -111,7 +111,7 @@ public: ...@@ -111,7 +111,7 @@ public:
return attributes_; return attributes_;
} }
private: private:
mtapi_action_attributes_t attributes_; mtapi_action_attributes_t attributes_;
}; };
......
...@@ -39,7 +39,7 @@ namespace mtapi { ...@@ -39,7 +39,7 @@ namespace mtapi {
* \ingroup CPP_MTAPI * \ingroup CPP_MTAPI
*/ */
class Affinity { class Affinity {
public: public:
/** /**
* Constructs an Affinity object. * Constructs an Affinity object.
*/ */
...@@ -135,7 +135,7 @@ public: ...@@ -135,7 +135,7 @@ public:
return affinity_; return affinity_;
} }
private: private:
mtapi_affinity_t affinity_; mtapi_affinity_t affinity_;
}; };
......
...@@ -39,7 +39,7 @@ namespace mtapi { ...@@ -39,7 +39,7 @@ namespace mtapi {
* \ingroup CPP_MTAPI * \ingroup CPP_MTAPI
*/ */
class GroupAttributes { class GroupAttributes {
public: public:
/** /**
* Constructs a GroupAttributes object. * Constructs a GroupAttributes object.
*/ */
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
return attributes_; return attributes_;
} }
private: private:
mtapi_group_attributes_t attributes_; mtapi_group_attributes_t attributes_;
}; };
......
...@@ -39,7 +39,7 @@ namespace mtapi { ...@@ -39,7 +39,7 @@ namespace mtapi {
* \ingroup CPP_MTAPI * \ingroup CPP_MTAPI
*/ */
class Job { class Job {
public: public:
/** /**
* Constructs a Job. * Constructs a Job.
* The Job object will be invalid. * The Job object will be invalid.
...@@ -91,11 +91,11 @@ public: ...@@ -91,11 +91,11 @@ public:
return handle_; return handle_;
} }
private: private:
mtapi_job_hndl_t handle_; mtapi_job_hndl_t handle_;
}; };
} // namespace mtapi } // namespace mtapi
} // namespace embb } // namespace embb
#endif // EMBB_MTAPI_GROUP_ATTRIBUTES_H_ #endif // EMBB_MTAPI_JOB_H_
...@@ -73,8 +73,7 @@ class Node { ...@@ -73,8 +73,7 @@ class Node {
if (IsInitialized()) { if (IsInitialized()) {
EMBB_THROW(StatusException, EMBB_THROW(StatusException,
"MTAPI: node was already initialized."); "MTAPI: node was already initialized.");
} } else {
else {
NodeAttributes attributes; // default attributes NodeAttributes attributes; // default attributes
node_instance_ = embb::base::Allocation::New<Node>( node_instance_ = embb::base::Allocation::New<Node>(
domain_id, node_id, attributes); domain_id, node_id, attributes);
...@@ -96,8 +95,7 @@ class Node { ...@@ -96,8 +95,7 @@ class Node {
if (IsInitialized()) { if (IsInitialized()) {
EMBB_THROW(StatusException, EMBB_THROW(StatusException,
"MTAPI: node was already initialized."); "MTAPI: node was already initialized.");
} } else {
else {
node_instance_ = embb::base::Allocation::New<Node>( node_instance_ = embb::base::Allocation::New<Node>(
domain_id, node_id, attributes); domain_id, node_id, attributes);
} }
...@@ -121,8 +119,7 @@ class Node { ...@@ -121,8 +119,7 @@ class Node {
static Node & GetInstance() { static Node & GetInstance() {
if (IsInitialized()) { if (IsInitialized()) {
return *node_instance_; return *node_instance_;
} } else {
else {
EMBB_THROW(StatusException, EMBB_THROW(StatusException,
"MTAPI: node is not initialized."); "MTAPI: node is not initialized.");
} }
...@@ -137,8 +134,7 @@ class Node { ...@@ -137,8 +134,7 @@ class Node {
if (IsInitialized()) { if (IsInitialized()) {
embb::base::Allocation::Delete(node_instance_); embb::base::Allocation::Delete(node_instance_);
node_instance_ = NULL; node_instance_ = NULL;
} } else {
else {
EMBB_THROW(StatusException, EMBB_THROW(StatusException,
"MTAPI: node is not initialized."); "MTAPI: node is not initialized.");
} }
......
...@@ -40,7 +40,7 @@ namespace mtapi { ...@@ -40,7 +40,7 @@ namespace mtapi {
* \ingroup CPP_MTAPI * \ingroup CPP_MTAPI
*/ */
class NodeAttributes { class NodeAttributes {
public: public:
/** /**
* Constructs a NodeAttributes object. * Constructs a NodeAttributes object.
*/ */
...@@ -226,7 +226,7 @@ public: ...@@ -226,7 +226,7 @@ public:
return attributes_; return attributes_;
} }
private: private:
mtapi_node_attributes_t attributes_; mtapi_node_attributes_t attributes_;
}; };
......
...@@ -39,7 +39,7 @@ namespace mtapi { ...@@ -39,7 +39,7 @@ namespace mtapi {
* \ingroup CPP_MTAPI * \ingroup CPP_MTAPI
*/ */
class QueueAttributes { class QueueAttributes {
public: public:
/** /**
* Constructs a QueueAttributes object. * Constructs a QueueAttributes object.
*/ */
...@@ -166,7 +166,7 @@ public: ...@@ -166,7 +166,7 @@ public:
return attributes_; return attributes_;
} }
private: private:
mtapi_queue_attributes_t attributes_; mtapi_queue_attributes_t attributes_;
}; };
......
...@@ -121,7 +121,7 @@ class Task { ...@@ -121,7 +121,7 @@ class Task {
} }
private: private:
Task(mtapi_task_hndl_t handle) explicit Task(mtapi_task_hndl_t handle)
: handle_(handle) { : handle_(handle) {
// empty // empty
} }
......
...@@ -39,7 +39,7 @@ namespace mtapi { ...@@ -39,7 +39,7 @@ namespace mtapi {
* \ingroup CPP_MTAPI * \ingroup CPP_MTAPI
*/ */
class TaskAttributes { class TaskAttributes {
public: public:
/** /**
* Constructs a TaskAttributes object. * Constructs a TaskAttributes object.
*/ */
...@@ -115,7 +115,7 @@ public: ...@@ -115,7 +115,7 @@ public:
return attributes_; return attributes_;
} }
private: private:
mtapi_task_attributes_t attributes_; mtapi_task_attributes_t attributes_;
}; };
......
...@@ -50,7 +50,7 @@ class TaskContext { ...@@ -50,7 +50,7 @@ class TaskContext {
: context_(task_context) { : context_(task_context) {
// empty // empty
} }
/** /**
* Queries whether the Task running in the TaskContext should finish. * Queries whether the Task running in the TaskContext should finish.
* \return \c true if the Task should finish, otherwise \c false * \return \c true if the Task should finish, otherwise \c false
......
...@@ -111,7 +111,8 @@ void TaskTest::TestBasic() { ...@@ -111,7 +111,8 @@ void TaskTest::TestBasic() {
{ {
embb::mtapi::Job job_error(JOB_TEST_ERROR, THIS_DOMAIN_ID); embb::mtapi::Job job_error(JOB_TEST_ERROR, THIS_DOMAIN_ID);
embb::mtapi::Action action_error(JOB_TEST_ERROR, testErrorAction, embb::mtapi::ActionAttributes()); embb::mtapi::Action action_error(JOB_TEST_ERROR, testErrorAction,
embb::mtapi::ActionAttributes());
std::string test; std::string test;
embb::mtapi::Task task = node.Start(job_error, "simple", &test); embb::mtapi::Task task = node.Start(job_error, "simple", &test);
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef MTAPI_CPP_TEST_MTAPI_CPP_TEST_TASK_H_ #ifndef TASKS_CPP_TEST_TASKS_CPP_TEST_TASK_H_
#define MTAPI_CPP_TEST_MTAPI_CPP_TEST_TASK_H_ #define TASKS_CPP_TEST_TASKS_CPP_TEST_TASK_H_
#include <partest/partest.h> #include <partest/partest.h>
...@@ -37,4 +37,4 @@ class TaskTest : public partest::TestCase { ...@@ -37,4 +37,4 @@ class TaskTest : public partest::TestCase {
void TestBasic(); void TestBasic();
}; };
#endif // MTAPI_CPP_TEST_MTAPI_CPP_TEST_TASK_H_ #endif // TASKS_CPP_TEST_TASKS_CPP_TEST_TASK_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment