📄 filter.cpp
字号:
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Revisions.....:
//===================================================================
#include <stdafx.h> // Precompiled headers.
#include <copyright.h>
#include <kernel/algorithms/filter.h>
#include <kernel/algorithms/keyword.h>
#include <kernel/structures/structures.h>
#include <kernel/basic/message.h>
//-------------------------------------------------------------------
// Methods for class Filter.
//===================================================================
//-------------------------------------------------------------------
// Constructors/destructor.
//===================================================================
Filter::Filter() {
InvertLogic(false);
}
Filter::~Filter() {
}
//-------------------------------------------------------------------
// Methods inherited from Identifier.
//===================================================================
IMPLEMENTIDMETHODS(Filter, FILTER, Algorithm)
//-------------------------------------------------------------------
// Methods inherited from Algorithm.
//===================================================================
//-------------------------------------------------------------------
// Method........: GetParameters
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================
String
Filter::GetParameters() const {
String parameters;
parameters += Keyword::Invert();
parameters += Keyword::Assignment();
parameters += String::Format(InvertLogic());
return parameters;
}
//-------------------------------------------------------------------
// Method........: SetParameter
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================
bool
Filter::SetParameter(const String &keyword, const String &value) {
if (keyword == Keyword::Invert() && value.IsBoolean())
return InvertLogic(value.GetBoolean());
return false;
}
//-------------------------------------------------------------------
// Method........: IsApplicable
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Returns true if the algorithm is applicable to the
// structure, false otherwise.
// Comments......:
// Revisions.....:
//===================================================================
bool
Filter::IsApplicable(const Structure &structure, bool /*warn*/) const {
return structure.IsA(STRUCTURES);
}
//-------------------------------------------------------------------
// Method........: Apply
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Takes a structure set as input and filters it according
// to some (overloaded) filtering scheme. By filtering is
// meant complete removal of individual member structures.
//
// Comments......: Assumes that library clients use handles.
//
// Revisions.....: A
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -