Aspose.Tasks for C++
Aspose::Tasks::TaskCollection Class Reference

Represents a collection of Task objects. More...

#include <TaskCollection.h>

Inherits System::Collections::Generic::IList< typename >.

Public Types

using iterator_holder_type = System::Collections::Generic::List< System::SharedPtr< Task > >
 A collection type whose iterator types is used as iterator types in the current collection.
 
using iterator = typename iterator_holder_type::iterator
 Iterator type.
 
using const_iterator = typename iterator_holder_type::const_iterator
 Const iterator type.
 
using virtualized_iterator_element = typename iterator_holder_type::virtualized_iterator_element
 Virtualized element type.
 
using virtualized_iterator = typename iterator_holder_type::virtualized_iterator
 Virtualized type.
 

Public Member Functions

int32_t get_Count () const override
 Gets the number of objects contained in the TaskCollection. More...
 
System::SharedPtr< Projectget_ParentProject ()
 Gets the parent project of the TaskCollection object. More...
 
bool get_IsReadOnly () const override
 Gets a value indicating whether this collection is read only. More...
 
System::SharedPtr< Taskidx_get (int32_t index) const override
 Returns the element at the specified index. More...
 
void idx_set (int32_t index, System::SharedPtr< Task > value) override
 Returns the element at the specified index. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< Task > > > GetEnumerator () override
 Returns an enumerator for this collection. More...
 
void Add (const System::SharedPtr< Task > &item) override
 Add the specified task to the instance of the TaskCollection class. If ParentProject.CalculationMode is None user should invoke Project.Recalculate() after using this method (It will reschedule all project tasks (start/finish dates, sets early/late dates) and calculate the dependent fields such as slacks, work and cost fields, ids and outline levels). If ParentProject.CalculationMode is Manual the method will calculate only task id, outline level and outline numbers automatically. If ParentProject.CalculationMode is Automatic the method reschedules all project's tasks automatically (start/finish dates, sets early/late dates, calculates slacks, work and cost fields, recalculates ids and outline levels). More...
 
void Insert (int32_t index, const System::SharedPtr< Task > &item) override
 This is the stub implementation of IList's Insert method, that only throws NotSupportedException More...
 
bool Remove (const System::SharedPtr< Task > &item) override
 This is the stub implementation of ICollection's Remove method, that only throws NotSupportedException More...
 
System::SharedPtr< TaskAdd ()
 Adds new task to project tasks collection on the same outline level of the last task. More...
 
System::SharedPtr< TaskAdd (const System::String &taskName)
 Adds a new task to children tasks collection. More...
 
System::SharedPtr< TaskAdd (const System::String &taskName, int32_t beforeTaskId)
 Adds a new recurring task to children tasks collection. More...
 
System::SharedPtr< TaskAdd (const System::SharedPtr< RecurringTaskParameters > &parameters)
 Inserts a new task before a task with the specified id and on the same outline level. More...
 
System::SharedPtr< System::Collections::Generic::List< System::SharedPtr< Task > > > ToList ()
 Converts the TaskCollection object to a list of Task objects. More...
 
System::SharedPtr< TaskGetByUid (int32_t uid)
 Returns a task with the specified Uid whose ancestor is parent task of this collection . More...
 
System::SharedPtr< TaskGetById (int32_t id)
 Returns a task with the specified Id whose ancestor is parent task of this collection . More...
 
bool Contains (const System::SharedPtr< Task > &item) const override
 Checks if collection contains specified item. More...
 
iterator begin () noexcept
 
iterator end () noexcept
 
const_iterator begin () const noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
virtualized_iteratorvirtualizeBeginIterator () override
 
virtualized_iteratorvirtualizeEndIterator () override
 
virtualized_iteratorvirtualizeBeginConstIterator () const override
 
virtualized_iteratorvirtualizeEndConstIterator () const override
 

Detailed Description

Represents a collection of Task objects.

Member Function Documentation

◆ Add() [1/5]

System::SharedPtr<Task> Aspose::Tasks::TaskCollection::Add ( )

Adds new task to project tasks collection on the same outline level of the last task.

Returns
returns the newly added instance of the Task class.

◆ Add() [2/5]

System::SharedPtr<Task> Aspose::Tasks::TaskCollection::Add ( const System::SharedPtr< RecurringTaskParameters > &  parameters)

Inserts a new task before a task with the specified id and on the same outline level.

Parameters
parametersThe parameters the specified parameters for creation of recurring task.
Returns
returns the newly added instance of the Task class.
Exceptions
ArgumentNullExceptionThrown if the specified parameters are null.
ArgumentExceptionThrown if the specified parameters are invalid.

◆ Add() [3/5]

void Aspose::Tasks::TaskCollection::Add ( const System::SharedPtr< Task > &  item)
override

Add the specified task to the instance of the TaskCollection class. If ParentProject.CalculationMode is None user should invoke Project.Recalculate() after using this method (It will reschedule all project tasks (start/finish dates, sets early/late dates) and calculate the dependent fields such as slacks, work and cost fields, ids and outline levels). If ParentProject.CalculationMode is Manual the method will calculate only task id, outline level and outline numbers automatically. If ParentProject.CalculationMode is Automatic the method reschedules all project's tasks automatically (start/finish dates, sets early/late dates, calculates slacks, work and cost fields, recalculates ids and outline levels).

Parameters
itemthe specified task which should be added to this task collection.

◆ Add() [4/5]

System::SharedPtr<Task> Aspose::Tasks::TaskCollection::Add ( const System::String &  taskName)

Adds a new task to children tasks collection.

Parameters
taskNamethe specified task name.
Returns
returns the newly added instance of the Task class.

◆ Add() [5/5]

System::SharedPtr<Task> Aspose::Tasks::TaskCollection::Add ( const System::String &  taskName,
int32_t  beforeTaskId 
)

Adds a new recurring task to children tasks collection.

Parameters
taskNamethe specified task name.
beforeTaskIdThe specified id of a task before which a new task will be inserted.
Returns
returns a task which was inserted before a task with the specified id.
Exceptions
ArgumentOutOfRangeExceptionArgumentOutOfRangeException is thrown if the specified id is not a valid task id.

◆ begin() [1/2]

const_iterator Aspose::Tasks::TaskCollection::begin ( ) const
noexcept

Gets iterator pointing to the first element (if any) of the const-qualified instance of the collection.

Returns
An iterator pointing to the first element (if any) of the const-qualified instance of the collection

◆ begin() [2/2]

iterator Aspose::Tasks::TaskCollection::begin ( )
noexcept

Gets iterator pointing to the first element (if any) of the collection.

Returns
An iterator pointing to the first element (if any) of the collection

◆ cbegin()

const_iterator Aspose::Tasks::TaskCollection::cbegin ( ) const
noexcept

Gets iterator pointing to the first const-qualified element (if any) of the collection.

Returns
An iterator pointing to the first const-qualified element (if any) of the collection

◆ cend()

const_iterator Aspose::Tasks::TaskCollection::cend ( ) const
noexcept

Gets iterator pointing right after the last const-qualified element (if any) of the collection.

Returns
An iterator pointing right after the last const-qualified element (if any) of the collection

◆ Contains()

bool Aspose::Tasks::TaskCollection::Contains ( const System::SharedPtr< Task > &  item) const
override

Checks if collection contains specified item.

Parameters
itemThe item to check.
Returns
true, if collection contains an item, false otherwise.

◆ end() [1/2]

const_iterator Aspose::Tasks::TaskCollection::end ( ) const
noexcept

Gets iterator pointing right after the last element (if any) of the const-qualified instance of the collection.

Returns
An iterator pointing right after the last element (if any) of the const-qualified instance of the collection

◆ end() [2/2]

iterator Aspose::Tasks::TaskCollection::end ( )
noexcept

Gets iterator pointing right after the last element (if any) of the collection.

Returns
An iterator pointing right after the last element (if any) of the collection

◆ get_Count()

int32_t Aspose::Tasks::TaskCollection::get_Count ( ) const
override

Gets the number of objects contained in the TaskCollection.

◆ get_IsReadOnly()

bool Aspose::Tasks::TaskCollection::get_IsReadOnly ( ) const
override

Gets a value indicating whether this collection is read only.

◆ get_ParentProject()

System::SharedPtr<Project> Aspose::Tasks::TaskCollection::get_ParentProject ( )

Gets the parent project of the TaskCollection object.

◆ GetById()

System::SharedPtr<Task> Aspose::Tasks::TaskCollection::GetById ( int32_t  id)

Returns a task with the specified Id whose ancestor is parent task of this collection .

Parameters
idTaskEntity Id
Returns
returns the instance of Task class with the specified id whose ancestor is parent task of this collection.

◆ GetByUid()

System::SharedPtr<Task> Aspose::Tasks::TaskCollection::GetByUid ( int32_t  uid)

Returns a task with the specified Uid whose ancestor is parent task of this collection .

Parameters
uidTaskEntity Uid.
Returns
returns the instance of Task class with the specified uid whose ancestor is parent task of this collection.

◆ GetEnumerator()

System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<Task> > > Aspose::Tasks::TaskCollection::GetEnumerator ( )
override

Returns an enumerator for this collection.

Returns
an enumerator for this collection.

◆ idx_get()

System::SharedPtr<Task> Aspose::Tasks::TaskCollection::idx_get ( int32_t  index) const
override

Returns the element at the specified index.

Parameters
indexThe zero-based index of the element to get.
Returns
the element at the specified index.

◆ idx_set()

void Aspose::Tasks::TaskCollection::idx_set ( int32_t  index,
System::SharedPtr< Task value 
)
override

Returns the element at the specified index.

Parameters
indexThe zero-based index of the element to get.
valuethe element at the specified index.

◆ Insert()

void Aspose::Tasks::TaskCollection::Insert ( int32_t  index,
const System::SharedPtr< Task > &  item 
)
override

This is the stub implementation of IList's Insert method, that only throws NotSupportedException

Parameters
indexThe index to insert at.
itemThe item to insert.

◆ Remove()

bool Aspose::Tasks::TaskCollection::Remove ( const System::SharedPtr< Task > &  item)
override

This is the stub implementation of ICollection's Remove method, that only throws NotSupportedException

Parameters
itemThe item to remove.
Returns
true if the item was removed; false otherwise.

◆ ToList()

System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Task> > > Aspose::Tasks::TaskCollection::ToList ( )

Converts the TaskCollection object to a list of Task objects.

Returns
returns a list which contains the Task class instances of this collection.

◆ virtualizeBeginConstIterator()

virtualized_iterator* Aspose::Tasks::TaskCollection::virtualizeBeginConstIterator ( ) const
override

Gets iterator pointing to the first element (if any)of the const-qualified instance of the collection.

Returns
An iterator pointing to the first element (if any)of the const-qualified instance of the collection Provides const iterator implementation to container's first element.
Newly-created iterator object.

◆ virtualizeBeginIterator()

virtualized_iterator* Aspose::Tasks::TaskCollection::virtualizeBeginIterator ( )
override

Gets iterator pointing to the first element (if any) of the collection.

Returns
An iterator pointing to the first element (if any) of the collection Provides iterator implementation to container's first element.
Newly-created iterator object.

◆ virtualizeEndConstIterator()

virtualized_iterator* Aspose::Tasks::TaskCollection::virtualizeEndConstIterator ( ) const
override

Gets iterator pointing right after the last element (if any)of the const-qualified instance of the collection.

Returns
An iterator pointing right after the last element (if any)of the const-qualified instance of the collection Provides const iterator implementation to container's end.
Newly-created iterator object.

◆ virtualizeEndIterator()

virtualized_iterator* Aspose::Tasks::TaskCollection::virtualizeEndIterator ( )
override

Gets iterator pointing right after the last element (if any) of the collection.

Returns
An iterator pointing right after the last element (if any) of the collection Provides iterator implementation to container's end.
Newly-created iterator object.