亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? structure.cpp

?? 粗糙集應用軟件
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
//-------------------------------------------------------------------
// Author........: Aleksander 豩rn
// Date..........: 960307
// Description...:
// Revisions.....:
//===================================================================

#include <stdafx.h> // Precompiled headers.
#include <copyright.h>

#include <kernel/structures/structure.h>
#include <kernel/structures/projectmanager.h>

#include <kernel/algorithms/algorithm.h>

//-------------------------------------------------------------------
// Static methods (file scope).
//===================================================================

//-------------------------------------------------------------------
// Method  ......: StaticRecursiveGetAllChildren
// Author........: Aleksander 豩rn/Daniel Remmem
// Date..........:
// Description...: Made static so as to hide the last recursion parameter
//                 for clients of GetAllChildren method.
// Comments......:
// Revisions.....:
//===================================================================

static bool
StaticRecursiveGetAllChildren(Id id, Identifier::Handles &children, const Structure *parent) {

	// Valid parent?
	if (parent == NULL)
		return false;

	int i;

	// Loop recursively over all children.
	for (i = 0; i < parent->GetNoChildren(); i++) {
		Handle<Structure> child = parent->GetChild(i);
		if (child->IsA(id))
			children.push_back(Handle<Identifier>(child.GetPointer()));
		if (!child->HasChildren())
			continue;
		if (!StaticRecursiveGetAllChildren(id, children, child.GetPointer()))
			return false;
	}

	return true;

}

//-------------------------------------------------------------------
// Method........: StaticRecursiveFindParent
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Called from FindParent, used to hide recursion.
//
//                 Given two structures, whereof one is a descendant
//                 of the other, returns the descendant's immediate
//                 parent. If the descendant appears as an internal
//                 member structure of a structure set, the structure
//                 set is returned. If the descendant appears as a
//                 direct child of a parent structure, the parent
//                 structure is returned. Otherwise, NULL is returned.
//
// Comments......: Note that traversal of internal member structures is
//                 not implemented, although it really should be.
//                 This may not be fatal however, since usually internal
//                 member structures are "simple" in the sense that they
//                 aren't parent structures themselves.
// Revisions.....:
//===================================================================

static Structure *
StaticRecursiveFindParent(const Structure *descendant, const Structure *ancestor) {

	// Check aregument validity.
	if (descendant == NULL || ancestor == NULL)
		return NULL;

	// Check if the descendant is an internal member of the ancestor.
	if (ancestor->IsMember(descendant))
	  return const_cast(Structure *, ancestor);

	int i, no_children = ancestor->GetNoChildren();

	// Iterate over all the ancestor's children.
	for (i = 0; i < no_children; i++) {

		// Get current child.
		Structure *child = ancestor->GetChild(i);

		// Is the current child and the descendant the same object?
		if (child == descendant)
			return const_cast(Structure *, ancestor);

		// Is the descendant an internal member of the current child?
		if (child->IsMember(descendant))
			return child;

		// Recurse.
		child = StaticRecursiveFindParent(descendant, child);

		// If the recursion was successful, return.
		if (child != NULL)
			return child;

	}

	// The structure is not a registered descendant of the given ancestor.
	return NULL;

}

//-------------------------------------------------------------------
// Methods for class Structure.
//===================================================================

//-------------------------------------------------------------------
// Constructors/destructor.
//===================================================================

Structure::Structure(const Structure &/*in*/) {
}

Structure::Structure() {
}

Structure::~Structure() {
}

//-------------------------------------------------------------------
// Methods inherited from Identifier.
//===================================================================

IMPLEMENTIDMETHODS(Structure, STRUCTURE, Persistent)

//-------------------------------------------------------------------
// Methods inherited from Persistent.
//===================================================================

//-------------------------------------------------------------------
// Method........: Load
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

bool
Structure::Load(ifstream &stream) {
  return Persistent::Load(stream);
}

//-------------------------------------------------------------------
// Method........: Save
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

bool
Structure::Save(ofstream &stream) const {
  return Persistent::Save(stream);
}


//-------------------------------------------------------------------
// Method........: Load
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

bool
Structure::Load(const String &filename) {
  return Persistent::Load(filename);
}

//-------------------------------------------------------------------
// Method........: Save
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

bool
Structure::Save(const String &filename) const {
  return Persistent::Save(filename);
}

//-------------------------------------------------------------------
// New methods.
//===================================================================

//-------------------------------------------------------------------
// Method........: Apply
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......:
// Revisions.....:
//===================================================================

Structure *
Structure::Apply(const Algorithm &algorithm) {
  return algorithm.Apply(*this);
}

//-------------------------------------------------------------------
// Name management methods.
//===================================================================

//-------------------------------------------------------------------
// Method........: GetName/SetName
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......: Makes the interface more uniform for structures
//                 with or without annotations.
//
//                 Should be overloaded by annotated structures.
// Revisions.....:
//===================================================================

const String &
Structure::GetName() const {
  return IdHolder::GetClassname(GetId());
}

bool
Structure::SetName(const String &/*name*/) {
  return false;
}

//-------------------------------------------------------------------
// Child management methods.
//===================================================================

//-------------------------------------------------------------------
// Method........: GetNoChildren
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......: Makes the interface more uniform for structures
//                 with or without children.
//
//                 Should be overloaded by structures with children
//                 (parent structures).
// Revisions.....:
//===================================================================

int
Structure::GetNoChildren() const {
	return 0;
}

//-------------------------------------------------------------------
// Method........: GetChild
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......: Makes the interface more uniform for structures with
//                 or without children.
//
//                 Should be overloaded by structures with children
//                 (parent structures).
// Revisions.....:
//===================================================================

Structure *
Structure::GetChild(int /*i*/) const {
	Message::Error("This method should never have been invoked.");
	return NULL;
}

//-------------------------------------------------------------------
// Method........: InsertChild
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......: Makes the interface more uniform for structures with
//                 or without children.
//
//                 Should be overloaded by structures with children
//                 (parent structures).
// Revisions.....:
//===================================================================

bool
Structure::InsertChild(Structure * /*child*/, int /*i*/) {
	return false;
}

//-------------------------------------------------------------------
// Method........: AppendChild
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......: Makes the interface more uniform for structures with
//                 or without children.
// Revisions.....:
//===================================================================

bool
Structure::AppendChild(Structure *child) {
	return InsertChild(child, GetNoChildren());
}

//-------------------------------------------------------------------
// Method........: RemoveChild
// Author........: Aleksander 豩rn
// Date..........:
// Description...:
// Comments......: Makes the interface more uniform for structures with
//                 or without children.
//
//                 Should be overloaded by structures with children
//                 (parent structures).
// Revisions.....:
//===================================================================

bool
Structure::RemoveChild(int /*i*/) {
  return false;
}

//-------------------------------------------------------------------
// Method........: RemoveAllChildren
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Removes all children.
// Comments......:
// Revisions.....:
//===================================================================

bool
Structure::RemoveAllChildren() {

  int i, no_children = GetNoChildren();

	for (i = no_children - 1; i >= 0; i--) {
		if (!RemoveChild(i))
			return false;
	}

	return true;

}

//-------------------------------------------------------------------
// Method........: GetAllChildren
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Returns (in place) an array of pointers (handles)
//                 to all children of a specified type.
// Comments......:
// Revisions.....:
//===================================================================

bool
Structure::GetAllChildren(Id id, Identifier::Handles &children, bool recursive) const {

	if (recursive)
		return StaticRecursiveGetAllChildren(id, children, this);

	int i;

	// Loop over all immediate children.
	for (i = 0; i < GetNoChildren(); i++) {
		Handle<Structure> child = GetChild(i);
		if (child->IsA(id))
			children.push_back(Handle<Identifier>(child.GetPointer()));
	}

	return true;

}

//-------------------------------------------------------------------
// Method........: FindChild
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Returns the child index of the argument structure,
//                 Undefined::Integer() if not found.
//
// Comments......: Physical (not logical) check.
// Revisions.....:
//===================================================================

int
Structure::FindChild(const Structure *child) const {

	int i, no_children = GetNoChildren();

  for (i = 0; i < no_children; i++) {
		if (child == GetChild(i))
			return i;
  }

  return Undefined::Integer();

}

//-------------------------------------------------------------------
// Method........: IsParent
// Author........: Aleksander 豩rn
// Date..........:
// Description...: Returns true if this structure is a parent of the
//                 argument structure. If the query is recursive,
//                 parenthood is generalized to being an ancestor.
// Comments......:
// Revisions.....:
//===================================================================

bool
Structure::IsParent(const Structure *child, bool recursive) const {

	// Check immediate children.
	if (FindChild(child) != Undefined::Integer())
		return true;

	if (!recursive)
		return false;

	int i;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
毛片不卡一区二区| 美女视频黄a大片欧美| 91精品国产综合久久久久久久久久 | 国产精品99久久久久久似苏梦涵| 悠悠色在线精品| 国产清纯白嫩初高生在线观看91 | 高清国产午夜精品久久久久久| 亚洲国产一二三| 中文字幕+乱码+中文字幕一区| 欧美一级日韩免费不卡| 在线亚洲一区二区| 夫妻av一区二区| 国产又粗又猛又爽又黄91精品| 日欧美一区二区| 亚洲香肠在线观看| 亚洲日本在线观看| 亚洲国产成人在线| 久久午夜羞羞影院免费观看| 欧美一区二区二区| 欧美日韩精品一区二区三区四区| 91精品麻豆日日躁夜夜躁| 一本久久a久久免费精品不卡| 成人性生交大片免费看在线播放 | 亚洲桃色在线一区| 中文字幕av一区二区三区| 国产清纯白嫩初高生在线观看91 | 日韩成人精品视频| 亚洲午夜一二三区视频| 亚洲精品大片www| 亚洲天堂2016| 中文字幕一区二区三区四区| 国产三级三级三级精品8ⅰ区| 久久色在线观看| 欧美va亚洲va在线观看蝴蝶网| 在线播放中文一区| 欧美日韩精品一区二区三区蜜桃| 欧美无乱码久久久免费午夜一区 | 极品少妇xxxx精品少妇偷拍| 日本最新不卡在线| 天堂影院一区二区| 性做久久久久久久久| 丝袜诱惑亚洲看片| 日韩成人精品视频| 精品一区二区三区在线播放| 精品夜夜嗨av一区二区三区| 激情综合五月婷婷| 国产黄色精品视频| 99在线视频精品| 色素色在线综合| 8x福利精品第一导航| 欧美大片国产精品| 国产欧美一区二区精品久导航| 欧美国产一区二区| 亚洲精品菠萝久久久久久久| 亚洲午夜在线视频| 久久国产精品免费| 日韩欧美国产综合一区| 久久亚洲精品国产精品紫薇| 国产精品嫩草99a| 亚洲精品国产一区二区精华液 | 亚洲视频香蕉人妖| 亚洲国产成人av网| 久久99精品久久久久久动态图 | 欧美日韩夫妻久久| 337p日本欧洲亚洲大胆精品| 中文字幕精品—区二区四季| 亚洲亚洲人成综合网络| 极品少妇一区二区三区精品视频 | 亚洲欧美日韩系列| 天堂蜜桃一区二区三区| 国产麻豆视频精品| 一本色道久久加勒比精品| 日韩午夜精品视频| 国产精品久久网站| 天天操天天干天天综合网| 国产露脸91国语对白| 一本久久精品一区二区| 欧美一级黄色大片| **性色生活片久久毛片| 爽爽淫人综合网网站| 国产91精品入口| 欧美午夜寂寞影院| 久久午夜免费电影| 午夜精品久久久久久| 懂色一区二区三区免费观看| 欧美日韩成人激情| 中文字幕一区二区视频| 日本女优在线视频一区二区| www.在线欧美| 精品少妇一区二区三区日产乱码| 亚洲精品免费视频| 国产成人综合在线观看| 欧美美女黄视频| 国产精品久久久久久久久免费相片| 日韩经典一区二区| 91免费视频网| 国产日产欧产精品推荐色 | 亚洲精品一二三区| 欧美专区亚洲专区| 国产精品污污网站在线观看| 青青草国产精品亚洲专区无| 91麻豆福利精品推荐| 久久久三级国产网站| 日韩极品在线观看| 欧美在线观看一二区| 国产欧美日本一区视频| 老司机精品视频一区二区三区| 欧美综合久久久| 亚洲欧美日韩精品久久久久| 国产不卡在线一区| 久久影院午夜片一区| 婷婷国产v国产偷v亚洲高清| 99re6这里只有精品视频在线观看| 久久久一区二区三区捆绑**| 美女视频免费一区| 91精品国产综合久久精品麻豆| 亚洲精品水蜜桃| 99精品视频在线免费观看| 中文字幕第一页久久| 国产精品中文有码| 久久蜜桃香蕉精品一区二区三区| 久久精品99国产精品日本| 在线播放/欧美激情| 亚洲成人免费视频| 欧美综合天天夜夜久久| 亚洲综合网站在线观看| 色婷婷综合久久久中文字幕| 亚洲色图欧美偷拍| 99久久精品情趣| 国产精品久久看| 成人av在线影院| 中文字幕乱码日本亚洲一区二区| 国产成a人亚洲精品| 欧美韩日一区二区三区| 不卡的看片网站| 国产精品成人在线观看| 91视频在线观看免费| 亚洲视频一区二区在线观看| 91蝌蚪porny九色| 亚洲一区在线免费观看| 欧美精品视频www在线观看| 亚洲不卡一区二区三区| 911国产精品| 精品系列免费在线观看| 久久久久久久久97黄色工厂| 国产98色在线|日韩| 亚洲欧洲另类国产综合| 91极品视觉盛宴| 午夜欧美视频在线观看| 日韩一区和二区| 国产毛片精品视频| 中文字幕在线观看一区二区| 91蝌蚪porny成人天涯| 亚洲午夜视频在线观看| 欧美一级理论片| 国产99久久久国产精品潘金网站| 亚洲天堂福利av| 制服丝袜激情欧洲亚洲| 国产高清视频一区| 依依成人精品视频| 精品美女被调教视频大全网站| 国产精品一二三四| 亚洲综合色自拍一区| 欧美xxxxxxxx| av高清久久久| 日本午夜一本久久久综合| 国产亚洲欧美色| 在线观看网站黄不卡| 美女www一区二区| 中文字幕在线不卡一区| 宅男在线国产精品| 成人激情免费视频| 五月天欧美精品| 欧美精彩视频一区二区三区| 欧美亚洲自拍偷拍| 激情欧美一区二区| 亚洲一级片在线观看| 久久综合九色综合欧美亚洲| 久久精品视频免费观看| 欧美中文字幕亚洲一区二区va在线| 九九视频精品免费| 亚洲精品成人天堂一二三| 欧美精品一区二区三区在线播放| 91在线视频免费91| 久草精品在线观看| 亚洲另类春色校园小说| 日韩精品中午字幕| 色菇凉天天综合网| 国产成人av电影在线观看| 偷拍自拍另类欧美| 中文字幕人成不卡一区| 日韩免费视频一区| 色噜噜狠狠成人网p站| 国产精品中文字幕日韩精品 | 欧美剧情片在线观看| av中文字幕一区| 久久国产精品99久久久久久老狼 | 亚洲国产综合91精品麻豆| 日本一区二区三区电影| 精品区一区二区|