From 182c8f8357739f905bbd721006480502435b6b43 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 27 Nov 2022 12:04:31 -0800 Subject: Update brace style to match rest of my projects --- .../Cplt/Model/Workflow/Nodes/DocumentNodes.cpp | 9 ++-- .../Cplt/Model/Workflow/Nodes/DocumentNodes.hpp | 3 +- .../Cplt/Model/Workflow/Nodes/NumericNodes.cpp | 24 ++++------ .../Cplt/Model/Workflow/Nodes/NumericNodes.hpp | 9 ++-- app/source/Cplt/Model/Workflow/Nodes/TextNodes.cpp | 51 ++++++++-------------- app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp | 9 ++-- .../Cplt/Model/Workflow/Nodes/UserInputNodes.cpp | 18 +++----- .../Cplt/Model/Workflow/Nodes/UserInputNodes.hpp | 6 +-- 8 files changed, 43 insertions(+), 86 deletions(-) (limited to 'app/source/Cplt/Model/Workflow/Nodes') diff --git a/app/source/Cplt/Model/Workflow/Nodes/DocumentNodes.cpp b/app/source/Cplt/Model/Workflow/Nodes/DocumentNodes.cpp index df4a8bb..202f8cf 100644 --- a/app/source/Cplt/Model/Workflow/Nodes/DocumentNodes.cpp +++ b/app/source/Cplt/Model/Workflow/Nodes/DocumentNodes.cpp @@ -3,16 +3,13 @@ #include #include -bool DocumentTemplateExpansionNode::IsInstance(const WorkflowNode* node) -{ +bool DocumentTemplateExpansionNode::IsInstance(const WorkflowNode* node) { return node->GetKind() == KD_DocumentTemplateExpansion; } DocumentTemplateExpansionNode::DocumentTemplateExpansionNode() - : WorkflowNode(KD_DocumentTemplateExpansion, false) -{ + : WorkflowNode(KD_DocumentTemplateExpansion, false) { } -void DocumentTemplateExpansionNode::Evaluate(WorkflowEvaluationContext& ctx) -{ +void DocumentTemplateExpansionNode::Evaluate(WorkflowEvaluationContext& ctx) { } diff --git a/app/source/Cplt/Model/Workflow/Nodes/DocumentNodes.hpp b/app/source/Cplt/Model/Workflow/Nodes/DocumentNodes.hpp index a266b2c..2a49a91 100644 --- a/app/source/Cplt/Model/Workflow/Nodes/DocumentNodes.hpp +++ b/app/source/Cplt/Model/Workflow/Nodes/DocumentNodes.hpp @@ -2,8 +2,7 @@ #include -class DocumentTemplateExpansionNode : public WorkflowNode -{ +class DocumentTemplateExpansionNode : public WorkflowNode { public: static bool IsInstance(const WorkflowNode* node); DocumentTemplateExpansionNode(); diff --git a/app/source/Cplt/Model/Workflow/Nodes/NumericNodes.cpp b/app/source/Cplt/Model/Workflow/Nodes/NumericNodes.cpp index f8b29bb..8a47423 100644 --- a/app/source/Cplt/Model/Workflow/Nodes/NumericNodes.cpp +++ b/app/source/Cplt/Model/Workflow/Nodes/NumericNodes.cpp @@ -9,8 +9,7 @@ #include #include -WorkflowNode::Kind NumericOperationNode::OperationTypeToNodeKind(OperationType type) -{ +WorkflowNode::Kind NumericOperationNode::OperationTypeToNodeKind(OperationType type) { switch (type) { case Addition: return KD_NumericAddition; case Subtraction: return KD_NumericSubtraction; @@ -20,8 +19,7 @@ WorkflowNode::Kind NumericOperationNode::OperationTypeToNodeKind(OperationType t } } -NumericOperationNode::OperationType NumericOperationNode::NodeKindToOperationType(Kind kind) -{ +NumericOperationNode::OperationType NumericOperationNode::NodeKindToOperationType(Kind kind) { switch (kind) { case KD_NumericAddition: return Addition; case KD_NumericSubtraction: return Subtraction; @@ -31,15 +29,13 @@ NumericOperationNode::OperationType NumericOperationNode::NodeKindToOperationTyp } } -bool NumericOperationNode::IsInstance(const WorkflowNode* node) -{ +bool NumericOperationNode::IsInstance(const WorkflowNode* node) { return node->GetKind() >= KD_NumericAddition && node->GetKind() <= KD_NumericDivision; } NumericOperationNode::NumericOperationNode(OperationType type) : WorkflowNode(OperationTypeToNodeKind(type), false) - , mType{ type } -{ + , mType{ type } { mInputs.resize(2); mInputs[0].MatchingType = BaseValue::KD_Numeric; mInputs[1].MatchingType = BaseValue::KD_Numeric; @@ -48,8 +44,7 @@ NumericOperationNode::NumericOperationNode(OperationType type) mOutputs[0].MatchingType = BaseValue::KD_Numeric; } -void NumericOperationNode::Evaluate(WorkflowEvaluationContext& ctx) -{ +void NumericOperationNode::Evaluate(WorkflowEvaluationContext& ctx) { auto lhsVal = dyn_cast(ctx.GetConnectionValue(mInputs[0])); if (!lhsVal) return; double lhs = lhsVal->GetValue(); @@ -79,16 +74,13 @@ void NumericOperationNode::Evaluate(WorkflowEvaluationContext& ctx) ctx.SetConnectionValue(mOutputs[0], std::move(value)); } -bool NumericExpressionNode::IsInstance(const WorkflowNode* node) -{ +bool NumericExpressionNode::IsInstance(const WorkflowNode* node) { return node->GetKind() == KD_NumericExpression; } NumericExpressionNode::NumericExpressionNode() - : WorkflowNode(KD_NumericExpression, false) -{ + : WorkflowNode(KD_NumericExpression, false) { } -void NumericExpressionNode::Evaluate(WorkflowEvaluationContext& ctx) -{ +void NumericExpressionNode::Evaluate(WorkflowEvaluationContext& ctx) { } diff --git a/app/source/Cplt/Model/Workflow/Nodes/NumericNodes.hpp b/app/source/Cplt/Model/Workflow/Nodes/NumericNodes.hpp index 3c89708..0d3120b 100644 --- a/app/source/Cplt/Model/Workflow/Nodes/NumericNodes.hpp +++ b/app/source/Cplt/Model/Workflow/Nodes/NumericNodes.hpp @@ -7,11 +7,9 @@ #include #include -class NumericOperationNode : public WorkflowNode -{ +class NumericOperationNode : public WorkflowNode { public: - enum OperationType - { + enum OperationType { Addition, Subtraction, Multiplication, @@ -33,8 +31,7 @@ public: virtual void Evaluate(WorkflowEvaluationContext& ctx) override; }; -class NumericExpressionNode : public WorkflowNode -{ +class NumericExpressionNode : public WorkflowNode { public: static bool IsInstance(const WorkflowNode* node); NumericExpressionNode(); diff --git a/app/source/Cplt/Model/Workflow/Nodes/TextNodes.cpp b/app/source/Cplt/Model/Workflow/Nodes/TextNodes.cpp index 9b31f7a..4bca0c8 100644 --- a/app/source/Cplt/Model/Workflow/Nodes/TextNodes.cpp +++ b/app/source/Cplt/Model/Workflow/Nodes/TextNodes.cpp @@ -11,12 +11,10 @@ #include #include -class TextFormatterNode::Impl -{ +class TextFormatterNode::Impl { public: template - static void ForArguments(std::vector::iterator begin, std::vector::iterator end, const TFunction& func) - { + static void ForArguments(std::vector::iterator begin, std::vector::iterator end, const TFunction& func) { for (auto it = begin; it != end; ++it) { auto& elm = *it; if (auto arg = std::get_if(&elm)) { @@ -26,8 +24,7 @@ public: } /// Find the pin index that the \c elmIdx -th element should have, based on the elements coming before it. - static int FindPinForElement(const std::vector& vec, int elmIdx) - { + static int FindPinForElement(const std::vector& vec, int elmIdx) { for (int i = elmIdx; i >= 0; --i) { auto& elm = vec[i]; if (auto arg = std::get_if(&elm)) { @@ -38,8 +35,7 @@ public: } }; -BaseValue::Kind TextFormatterNode::ArgumentTypeToValueKind(TextFormatterNode::ArgumentType arg) -{ +BaseValue::Kind TextFormatterNode::ArgumentTypeToValueKind(TextFormatterNode::ArgumentType arg) { switch (arg) { case NumericArgument: return BaseValue::KD_Numeric; case TextArgument: return BaseValue::KD_Text; @@ -47,28 +43,23 @@ BaseValue::Kind TextFormatterNode::ArgumentTypeToValueKind(TextFormatterNode::Ar } } -bool TextFormatterNode::IsInstance(const WorkflowNode* node) -{ +bool TextFormatterNode::IsInstance(const WorkflowNode* node) { return node->GetKind() == KD_TextFormatting; } TextFormatterNode::TextFormatterNode() - : WorkflowNode(KD_TextFormatting, false) -{ + : WorkflowNode(KD_TextFormatting, false) { } -int TextFormatterNode::GetElementCount() const -{ +int TextFormatterNode::GetElementCount() const { return mElements.size(); } -const TextFormatterNode::Element& TextFormatterNode::GetElement(int idx) const -{ +const TextFormatterNode::Element& TextFormatterNode::GetElement(int idx) const { return mElements[idx]; } -void TextFormatterNode::SetElement(int idx, std::string text) -{ +void TextFormatterNode::SetElement(int idx, std::string text) { assert(idx >= 0 && idx < mElements.size()); std::visit( @@ -82,8 +73,7 @@ void TextFormatterNode::SetElement(int idx, std::string text) mElements[idx] = std::move(text); } -void TextFormatterNode::SetElement(int idx, ArgumentType argument) -{ +void TextFormatterNode::SetElement(int idx, ArgumentType argument) { assert(idx >= 0 && idx < mElements.size()); std::visit( @@ -115,8 +105,7 @@ void TextFormatterNode::SetElement(int idx, ArgumentType argument) mElements[idx]); } -void TextFormatterNode::InsertElement(int idx, std::string text) -{ +void TextFormatterNode::InsertElement(int idx, std::string text) { assert(idx >= 0); if (idx >= mElements.size()) AppendElement(std::move(text)); @@ -124,8 +113,7 @@ void TextFormatterNode::InsertElement(int idx, std::string text) mElements.insert(mElements.begin() + idx, std::move(text)); } -void TextFormatterNode::InsertElement(int idx, ArgumentType argument) -{ +void TextFormatterNode::InsertElement(int idx, ArgumentType argument) { assert(idx >= 0); if (idx >= mElements.size()) AppendElement(argument); @@ -144,14 +132,12 @@ void TextFormatterNode::InsertElement(int idx, ArgumentType argument) }); } -void TextFormatterNode::AppendElement(std::string text) -{ +void TextFormatterNode::AppendElement(std::string text) { mMinOutputChars += text.size(); mElements.push_back(std::move(text)); } -void TextFormatterNode::AppendElement(ArgumentType argument) -{ +void TextFormatterNode::AppendElement(ArgumentType argument) { int pinIdx = mInputs.size(); // Create pin mInputs.push_back(InputPin{}); @@ -163,8 +149,7 @@ void TextFormatterNode::AppendElement(ArgumentType argument) }); } -void TextFormatterNode::RemoveElement(int idx) -{ +void TextFormatterNode::RemoveElement(int idx) { assert(idx >= 0 && idx < mElements.size()); PreRemoveElement(idx); @@ -174,8 +159,7 @@ void TextFormatterNode::RemoveElement(int idx) mElements.erase(mElements.begin() + idx); } -void TextFormatterNode::Evaluate(WorkflowEvaluationContext& ctx) -{ +void TextFormatterNode::Evaluate(WorkflowEvaluationContext& ctx) { std::string result; result.reserve((size_t)(mMinOutputChars * 1.5f)); @@ -216,8 +200,7 @@ void TextFormatterNode::Evaluate(WorkflowEvaluationContext& ctx) } } -void TextFormatterNode::PreRemoveElement(int idx) -{ +void TextFormatterNode::PreRemoveElement(int idx) { auto& elm = mElements[idx]; if (auto arg = std::get_if(&elm)) { RemoveInputPin(arg->PinIdx); diff --git a/app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp b/app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp index 4689931..56eb19b 100644 --- a/app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp +++ b/app/source/Cplt/Model/Workflow/Nodes/TextNodes.hpp @@ -7,11 +7,9 @@ #include #include -class TextFormatterNode : public WorkflowNode -{ +class TextFormatterNode : public WorkflowNode { public: - enum ArgumentType - { + enum ArgumentType { NumericArgument, TextArgument, DateTimeArgument, @@ -20,8 +18,7 @@ public: private: class Impl; - struct Argument - { + struct Argument { ArgumentType Type; int PinIdx; }; diff --git a/app/source/Cplt/Model/Workflow/Nodes/UserInputNodes.cpp b/app/source/Cplt/Model/Workflow/Nodes/UserInputNodes.cpp index 93d458c..4b56052 100644 --- a/app/source/Cplt/Model/Workflow/Nodes/UserInputNodes.cpp +++ b/app/source/Cplt/Model/Workflow/Nodes/UserInputNodes.cpp @@ -3,30 +3,24 @@ #include #include -bool FormInputNode::IsInstance(const WorkflowNode* node) -{ +bool FormInputNode::IsInstance(const WorkflowNode* node) { return node->GetKind() == KD_FormInput; } FormInputNode::FormInputNode() - : WorkflowNode(KD_FormInput, false) -{ + : WorkflowNode(KD_FormInput, false) { } -void FormInputNode::Evaluate(WorkflowEvaluationContext& ctx) -{ +void FormInputNode::Evaluate(WorkflowEvaluationContext& ctx) { } -bool DatabaseRowsInputNode::IsInstance(const WorkflowNode* node) -{ +bool DatabaseRowsInputNode::IsInstance(const WorkflowNode* node) { return node->GetKind() == KD_DatabaseRowsInput; } DatabaseRowsInputNode::DatabaseRowsInputNode() - : WorkflowNode(KD_DatabaseRowsInput, false) -{ + : WorkflowNode(KD_DatabaseRowsInput, false) { } -void DatabaseRowsInputNode::Evaluate(WorkflowEvaluationContext& ctx) -{ +void DatabaseRowsInputNode::Evaluate(WorkflowEvaluationContext& ctx) { } diff --git a/app/source/Cplt/Model/Workflow/Nodes/UserInputNodes.hpp b/app/source/Cplt/Model/Workflow/Nodes/UserInputNodes.hpp index f0b923c..4ad4b02 100644 --- a/app/source/Cplt/Model/Workflow/Nodes/UserInputNodes.hpp +++ b/app/source/Cplt/Model/Workflow/Nodes/UserInputNodes.hpp @@ -2,8 +2,7 @@ #include -class FormInputNode : public WorkflowNode -{ +class FormInputNode : public WorkflowNode { public: static bool IsInstance(const WorkflowNode* node); FormInputNode(); @@ -12,8 +11,7 @@ public: virtual void Evaluate(WorkflowEvaluationContext& ctx) override; }; -class DatabaseRowsInputNode : public WorkflowNode -{ +class DatabaseRowsInputNode : public WorkflowNode { public: static bool IsInstance(const WorkflowNode* node); DatabaseRowsInputNode(); -- cgit v1.2.3-70-g09d2