diff --git a/mtapi_cpp/include/embb/mtapi/action.h b/mtapi_cpp/include/embb/mtapi/action.h index 28ef3c7..f9f6c35 100644 --- a/mtapi_cpp/include/embb/mtapi/action.h +++ b/mtapi_cpp/include/embb/mtapi/action.h @@ -50,11 +50,23 @@ class Action { handle_.tag = 0; } - Action(Action const & other) : handle_(other.handle_) { + /** + * Copies an Action. + */ + Action( + Action const & other /**< Action to copy */ + ) : handle_(other.handle_) { // empty } - Action & operator=(Action const & other) { + /** + * Copies an Action. + * + * \returns Reference to this object. + */ + Action & operator=( + Action const & other /**< Action to copy */ + ) { handle_ = other.handle_; return *this; } diff --git a/mtapi_cpp/include/embb/mtapi/group.h b/mtapi_cpp/include/embb/mtapi/group.h index 8810d5f..ac620eb 100644 --- a/mtapi_cpp/include/embb/mtapi/group.h +++ b/mtapi_cpp/include/embb/mtapi/group.h @@ -51,11 +51,23 @@ namespace mtapi { */ class Group { public: - Group(Group const & other) : handle_(other.handle_) { + /** + * Copies a Group. + */ + Group( + Group const & other /**< Group to copy */ + ) : handle_(other.handle_) { // empty } - Group & operator=(Group const & other) { + /** + * Copies a Group. + * + * \returns Reference to this object. + */ + Group & operator=( + Group const & other /**< Group to copy */ + ) { handle_ = other.handle_; return *this; } diff --git a/mtapi_cpp/include/embb/mtapi/node.h b/mtapi_cpp/include/embb/mtapi/node.h index 75ead82..c45056e 100644 --- a/mtapi_cpp/include/embb/mtapi/node.h +++ b/mtapi_cpp/include/embb/mtapi/node.h @@ -68,6 +68,9 @@ namespace mtapi { */ class Node { public: + /** + * Function type for simple SMP interface. + */ typedef embb::base::Function SMPFunction; /** @@ -285,16 +288,33 @@ class Node { MTAPI_DEFAULT_TASK_ATTRIBUTES); } - Job GetJob(mtapi_job_id_t job_id) { + /** + * Get the job with the given id in the domain of the node. + * + * \returns The handle for the requested Job. + */ + Job GetJob( + mtapi_job_id_t job_id /**< ID of the job to return */ + ) { return Job(job_id, domain_id_); } - Job GetJob(mtapi_job_id_t job_id, mtapi_domain_t domain_id) { + /** + * Get the job with the given id in the specified domain. + * + * \returns The handle for the requested Job. + */ + Job GetJob( + mtapi_job_id_t job_id, /**< ID of the job to return */ + mtapi_domain_t domain_id /**< Domain to get the job from */ + ) { return Job(job_id, domain_id); } /** * Constructs an Action. + * + * \returns The handle for the new Action. */ Action CreateAction( mtapi_job_id_t job_id, /**< Job ID the Action belongs to */ @@ -311,6 +331,8 @@ class Node { /** * Constructs an Action. + * + * \returns The handle for the new Action. */ Action CreateAction( mtapi_job_id_t job_id, /**< Job ID the Action belongs to */ @@ -325,6 +347,8 @@ class Node { /** * Constructs an Action. + * + * \returns The handle for the new Action. */ Action CreateAction( mtapi_job_id_t job_id, /**< Job ID the Action belongs to */ @@ -337,6 +361,8 @@ class Node { /** * Constructs an Action. + * + * \returns The handle for the new Action. */ Action CreateAction( mtapi_job_id_t job_id, /**< Job ID the Action belongs to */ @@ -347,6 +373,8 @@ class Node { /** * Constructs a Group object with default attributes. + * + * \returns The handle for the new Group. */ Group CreateGroup() { return Group(MTAPI_GROUP_ID_NONE, MTAPI_DEFAULT_GROUP_ATTRIBUTES); @@ -354,6 +382,8 @@ class Node { /** * Constructs a Group object with default attributes and the given ID. + * + * \returns The handle for the new Group. */ Group CreateGroup( mtapi_group_id_t id /**< A user defined ID of the Group. */ @@ -363,14 +393,19 @@ class Node { /** * Constructs a Group object using the given Attributes. + * + * \returns The handle for the new Group. */ Group CreateGroup( - GroupAttributes const & group_attr) { + GroupAttributes const & group_attr /**< Attributes for the Group. */ + ) { return Group(MTAPI_GROUP_ID_NONE, &group_attr.GetInternal()); } /** * Constructs a Group object with given attributes and ID. + * + * \returns The handle for the new Group. */ Group CreateGroup( mtapi_group_id_t id, /**< A user defined ID of the Group. */ @@ -381,6 +416,8 @@ class Node { /** * Constructs a Queue with the given Job and default attributes. + * + * \returns The handle for the new Queue. */ Queue CreateQueue( Job & job /**< The Job to use for the Queue. */ @@ -390,6 +427,8 @@ class Node { /** * Constructs a Queue with the given Job and QueueAttributes. + * + * \returns The handle for the new Queue. */ Queue CreateQueue( Job const & job, /**< The Job to use for the Queue. */ diff --git a/mtapi_cpp/include/embb/mtapi/queue.h b/mtapi_cpp/include/embb/mtapi/queue.h index 5f372b2..c747b59 100644 --- a/mtapi_cpp/include/embb/mtapi/queue.h +++ b/mtapi_cpp/include/embb/mtapi/queue.h @@ -51,11 +51,23 @@ namespace mtapi { */ class Queue { public: - Queue(Queue const & other) : handle_(other.handle_) { + /** + * Copies a Queue. + */ + Queue( + Queue const & other /**< The Queue to copy */ + ) : handle_(other.handle_) { // empty } - Queue & operator=(Queue const & other) { + /** + * Copies a Queue. + * + * \returns Reference to this object. + */ + Queue & operator=( + Queue const & other /**< The Queue to copy */ + ) { handle_ = other.handle_; return *this; } diff --git a/mtapi_cpp/include/embb/mtapi/task_attributes.h b/mtapi_cpp/include/embb/mtapi/task_attributes.h index 2e7a305..0bed18f 100644 --- a/mtapi_cpp/include/embb/mtapi/task_attributes.h +++ b/mtapi_cpp/include/embb/mtapi/task_attributes.h @@ -103,8 +103,15 @@ class TaskAttributes { return *this; } + /** + * Sets the ExecutionPolicy of a Task. + * The policy influences the priority and affinity of a Task. + * + * \returns Reference to this object. + * \notthreadsafe + */ TaskAttributes & SetPolicy( - ExecutionPolicy const & policy + ExecutionPolicy const & policy /**< The policy to set. */ ) { SetPriority(policy.GetPriority()); SetAffinity(policy.GetAffinity());