Aspose.Tasks for C++
TreeAlgorithmBase.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="TreeAlgorithmBase.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/details/pointer_collection_helpers.h>
9 
10 #include "aspose.tasks.cpp/Util/ITreeAlgorithm.h"
11 
12 namespace Aspose {
13 
14 namespace Tasks {
15 
16 namespace Util {
17 
18 /// <summary>
19 /// A base class for implementations of <see cref="ITreeAlgorithm{T}"></see>
20 /// </summary>
21 /// <typeparam name="T">The type of the elements.</typeparam>
22 template<typename T>
24 {
27 
28  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
29  RTTI_INFO_TEMPLATE_CLASS(ThisType, ThisTypeBaseTypesInfo);
30 
31  template<typename FT0> friend class Aspose::Tasks::Util::TreeAlgorithmBase;
32 
33 public:
34 
35  /// <summary>
36  /// Called before processing of a node of a tree.
37  /// </summary>
38  /// <param name="el">Node to process.</param>
39  /// <param name="level">Tree node level.</param>
40  void PreAlg(T el, int32_t level) override
41  {
42  ASPOSE_UNUSED(el);
43  ASPOSE_UNUSED(level);
44  }
45 
46  /// <summary>
47  /// Processes a node of a tree.
48  /// </summary>
49  /// <param name="el">Node to process.</param>
50  /// <param name="level">Tree node level.</param>
51  void Alg(T el, int32_t level) override = 0;
52  /// <summary>
53  /// Called after processing of a node of a tree.
54  /// </summary>
55  /// <param name="el">Node to process.</param>
56  /// <param name="level">Tree node level.</param>
57  void PostAlg(T el, int32_t level) override
58  {
59  ASPOSE_UNUSED(el);
60  ASPOSE_UNUSED(level);
61  }
62 
63  void SetTemplateWeakPtr(uint32_t argument) override
64  {
65  switch (argument)
66  {
67  case 0:
68  break;
69 
70  }
71  }
72 
73 };
74 
75 } // namespace Util
76 } // namespace Tasks
77 } // namespace Aspose
78 
79 
A base class for implementations of ITreeAlgorithm{T}
Definition: TreeAlgorithmBase.h:23
void PostAlg(T el, int32_t level) override
Called after processing of a node of a tree.
Definition: TreeAlgorithmBase.h:57
void PreAlg(T el, int32_t level) override
Called before processing of a node of a tree.
Definition: TreeAlgorithmBase.h:40
Represents an algorithm that can be applied to a tree of objects T .
Definition: ITreeAlgorithm.h:22
void Alg(T el, int32_t level) override=0
Processes a node of a tree.