本文整理汇总了C++中dList类的典型用法代码示例。如果您正苦于以下问题:C++ dList类的具体用法?C++ dList怎么用?C++ dList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了dList类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetLoops
void dDataFlowGraph::GetLoops (dList<dLoop>& loops) const
{
for (dCIL::dListNode* node = m_function; node; node = node->GetNext()) {
dThreeAdressStmt& stmt = node->GetInfo();
if ((stmt.m_instruction == dThreeAdressStmt::m_nop) && (stmt.m_arg2.m_label == D_LOOP_HEADER_SYMBOL)) {
dList<dLoop>::dListNode* const loopNode = loops.Addtop();
dLoop& loop = loopNode->GetInfo();
loop.m_head = node;
int order = stmt.m_extraInformation;
for (dList<dLoop>::dListNode* root = loops.GetLast(); root != loops.GetFirst(); root = root->GetPrev()) {
int code = root->GetInfo().m_head->GetInfo().m_extraInformation;
if (code > order) {
loops.InsertAfter (root, loopNode);
break;
}
}
for (dCIL::dListNode* node1 = node->GetNext(); node1; node1 = node1->GetNext()) {
dThreeAdressStmt& stmt = node1->GetInfo();
int code = stmt.m_extraInformation;
if ((stmt.m_instruction == dThreeAdressStmt::m_nop) && (code == order) && (stmt.m_arg2.m_label == D_LOOP_TAIL_SYMBOL)) {
loop.m_tail = node1;
break;
}
}
}
}
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:30,代码来源:dDataFlowGraph.cpp
示例2: CompareSets
bool dDeterministicFiniteAutonata::CompareSets (dList<dAutomataState*>& setA, dTree<dAutomataState*,dAutomataState*>& setB) const
{
if (setA.GetCount() == setB.GetCount()) {
for (dList<dAutomataState*>::dListNode* node = setA.GetFirst(); node; node = node->GetNext()) {
if (!setB.Find(node->GetInfo())) {
return false;
}
}
return true;
}
return false;
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:12,代码来源:dDeterministicFiniteAutonata.cpp
示例3: GetUsedVariables
void dCILInstrMove::GetUsedVariables (dList<dArg*>& variablesList)
{
if (m_arg1.m_isPointer) {
variablesList.Append(&m_arg1);
} else {
switch (m_arg1.GetType().m_intrinsicType)
{
case m_constInt:
case m_constFloat:
break;
default:
variablesList.Append(&m_arg1);
}
}
}
开发者ID:fly-man-,项目名称:newton-dynamics,代码行数:16,代码来源:dCILInstrLoadStore.cpp
示例4: dState
dState (const dList<dItem>& itemSet)
:m_key(0), m_number(0), m_hasErroItem(false), m_goto(), m_actions(), m_transitions()
{
for (dListNode* node = itemSet.GetFirst(); node; node = node->GetNext()) {
AddItem (node->GetInfo());
}
}
开发者ID:famorcia,项目名称:newton-dynamics,代码行数:7,代码来源:dParserCompiler.cpp
示例5: while
void dAutomataState::GetStateArray (dList<dAutomataState*>& statesList)
{
dTree<dAutomataState*, dAutomataState*> filter;
int stack = 1;
dAutomataState* pool[256];
pool[0] = this;
filter.Insert(this, this);
while (stack) {
stack --;
dAutomataState* const state = pool[stack];
statesList.Append(state);
for (dList<dAutomataState::dTransition>::dListNode* node = state->m_transtions.GetFirst(); node; node = node->GetNext()) {
dAutomataState* const state = node->GetInfo().GetState();
if (!filter.Find (state)) {
pool[stack] = state;
filter.Insert(state, state);
stack ++;
_ASSERTE (stack < sizeof (pool)/sizeof (pool[0]));
}
}
}
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:25,代码来源:dAutomataState.cpp
示例6: out
void dBone::Save(const char* fileName, const dList<dBone*>& list)
{
TiXmlText* header;
TiXmlElement *root;
TiXmlDeclaration* decl;
TiXmlDocument out (fileName);
decl = new TiXmlDeclaration( "1.0", "", "" );
out.LinkEndChild( decl );
root = new TiXmlElement( "root" );
out.LinkEndChild(root);
header = new TiXmlText (XML_HEADER);
root->LinkEndChild(header);
for (dList<dBone*>::dListNode* node = list.GetFirst(); node; node = node->GetNext()) {
int stack;
TiXmlElement *skeleton;
const dBone* nodeArray[1024];
skeleton = new TiXmlElement( "skeleton" );
stack = 1;
nodeArray[0] = node->GetInfo();
while (stack) {
const char* name;
const dBone* node;
TiXmlElement* xmlNode;
stack --;
node = nodeArray[stack];
name = node->GetName();
xmlNode = new TiXmlElement( "bone" );
skeleton->LinkEndChild(xmlNode);
xmlNode->SetAttribute("name", name);
if (node->GetParent()) {
const char* parentName;
parentName = node->GetParent()->GetName();
xmlNode->SetAttribute("parent", parentName);
}
xmlNode->SetAttribute("boneID", node->GetBoneID());
char matrixBuffer[512];
dModel::FloatsToString (matrixBuffer, &node->m_localMatrix[0][0], 16);
xmlNode->SetAttribute("matrix", matrixBuffer);
for (node = node->GetChild(); node; node = node->GetSibling()) {
nodeArray[stack] = node;
stack ++;
}
}
root->LinkEndChild(skeleton);
}
out.SaveFile (fileName);
}
开发者ID:Zarius,项目名称:pseudoform,代码行数:60,代码来源:dBone.cpp
示例7: dArg
dCILInstrCall::dCILInstrCall(dCIL& program, const dString& returnValue, const dArgType& type, const dString& target, dList<dArg>& parameters)
:dCILTwoArgInstr (program, dArg (returnValue, type), dArg (target, dArgType()))
,m_tagetNode(NULL)
{
for (dList<dArg>::dListNode* node = parameters.GetFirst(); node; node = node->GetNext()) {
m_parameters.Append (node->GetInfo());
}
}
开发者ID:famorcia,项目名称:newton-dynamics,代码行数:8,代码来源:dCILInstrBranch.cpp
示例8: dArg
dCILInstrPhy::dCILInstrPhy (dCIL& program, const dString& name, const dArgType& type, const dBasicBlock* const basicBlock, dList<const dBasicBlock*>& sources)
:dCILSingleArgInstr(program, dArg(name, type))
{
m_basicBlock = (dBasicBlock*)basicBlock;
for (dList<const dBasicBlock*>::dListNode* node = sources.GetFirst(); node; node = node->GetNext()) {
m_sources.Append (dArgPair (m_arg0, node->GetInfo()));
}
}
开发者ID:fly-man-,项目名称:newton-dynamics,代码行数:8,代码来源:dCILInstrLoadStore.cpp
示例9: GetBoneList
void dModel::GetBoneList (dList<dBone*>& bodeList) const
{
for (dList<dBone*>::dListNode* node = m_skeleton.GetFirst(); node; node = node->GetNext()) {
dBone* rootbone = node->GetInfo();
for (dBone* bone = rootbone->GetFirst(); bone; bone = (dBone*) bone->GetNext()) {
bodeList.Append(bone);
}
}
}
开发者ID:Zarius,项目名称:pseudoform,代码行数:9,代码来源:dModel.cpp
示例10: dArg
dCILInstrPhy::dCILInstrPhy (dCIL& program, const dString& name, const dArgType& type, dList<dCILInstr*>& source, const dBasicBlock* const basicBlock)
:dCILSingleArgInstr(program, dArg(name, type))
{
m_basicBlock = (dBasicBlock*)basicBlock;
for (dList<dCILInstr*>::dListNode* node = source.GetFirst(); node; node = node->GetNext()) {
dCILInstr* const instruction = node->GetInfo();
m_sources.Append (instruction->GetNode());
}
}
开发者ID:kmammou,项目名称:newton-dynamics,代码行数:9,代码来源:dCILInstrLoadStore.cpp
示例11: IsStatementInReachList
bool dDataFlowGraph::IsStatementInReachList(dCIL::dListNode* const node, dList<dCIL::dListNode*>& definitionList, dCIL::dListNode* const me) const
{
const dDataFlowPoint& point = m_dataFlowGraph.Find (node)->GetInfo();
for (dList<dCIL::dListNode*>::dListNode* ptr = definitionList.GetFirst(); ptr; ptr = ptr->GetNext()) {
dCIL::dListNode* const defVarStmt = ptr->GetInfo();
if (defVarStmt != me) {
if (point.m_reachStmtInputSet.Find(defVarStmt)) {
return true;
}
}
}
return false;
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:13,代码来源:dDataFlowGraph.cpp
示例12: First
void dParserCompiler::First (
const dList<dCRCTYPE>& symbolSet,
const dTree<dTokenInfo, dCRCTYPE>& symbolList,
const dTree<dList<void*>, dCRCTYPE>& ruleMap,
dTree<int, dCRCTYPE>& firstSetOut) const
{
if (symbolSet.GetCount() > 1) {
dList<dCRCTYPE>::dListNode* node = symbolSet.GetFirst();
bool deriveEmpty = true;
while ((deriveEmpty) && node) {
dCRCTYPE symbol = node->GetInfo();
node = node->GetNext();
dTree<int, dCRCTYPE> tmpFirst;
dTree<int, dCRCTYPE> symbolListMark;
First (symbol, symbolListMark, symbolList, ruleMap, tmpFirst);
dTree<int, dCRCTYPE>::Iterator iter (tmpFirst);
deriveEmpty = false;
for (iter.Begin(); iter; iter ++) {
dCRCTYPE symbol = iter.GetKey();
if (symbol == 0) {
deriveEmpty = true;
} else {
firstSetOut.Insert(0, symbol);
}
}
}
if (deriveEmpty) {
firstSetOut.Insert(0, 0);
}
} else {
dCRCTYPE symbol = symbolSet.GetFirst()->GetInfo();
dTree<int, dCRCTYPE> symbolListMark;
First (symbol, symbolListMark, symbolList, ruleMap, firstSetOut);
}
}
开发者ID:famorcia,项目名称:newton-dynamics,代码行数:38,代码来源:dParserCompiler.cpp
示例13: Load
void dBone::Load(const char* fileName, dList<dBone*>& list, dLoaderContext& context)
{
const TiXmlElement* root;
TiXmlDocument doc (fileName);
doc.LoadFile();
root = doc.RootElement();
if (root && !strcmp (root->GetText (), "newton 2.0 file format")){
for (const TiXmlElement* skeleton = (TiXmlElement*)root->FirstChild("skeleton"); skeleton; skeleton = (TiXmlElement*)skeleton->NextSibling()) {
dBone* rootBone;
rootBone = NULL;
for (const TiXmlElement* node = (TiXmlElement*)skeleton->FirstChild("bone"); node; node = (TiXmlElement*)node->NextSibling()) {
dBone* bone;
const char* name;
const char* parent;
name = node->Attribute ("name");
parent = node->Attribute ("parent");
if (parent) {
dBone* parentBone;
parentBone = rootBone->Find (parent);
_ASSERTE (parentBone);
bone = context.CreateBone (parentBone);
} else {
bone = context.CreateBone (NULL);
rootBone = bone;
}
dMatrix matrix;
bone->SetNameID(name);
node->Attribute ("boneID", &bone->m_boneID);
dModel::StringToFloats (node->Attribute("matrix"), &matrix[0][0]);
bone->SetMatrix (matrix);
}
list.Append(rootBone);
}
}
}
开发者ID:Zarius,项目名称:pseudoform,代码行数:41,代码来源:dBone.cpp
示例14: GetNodeList
void RigidBodyWorldDesc::GetNodeList (dList<INode*>& list)
{
int stackIndex;
INode* stack[4096];
stackIndex = 1;
Interface* const ip = GetCOREInterface();
stack[0] = ip->GetRootNode();
while (stackIndex) {
stackIndex --;
INode* const node = stack[stackIndex];
list.Append(node);
for (int i = 0; i < node->NumberOfChildren(); i ++) {
stack[stackIndex] = node->GetChildNode(i);
stackIndex ++;
_ASSERTE (stackIndex * sizeof (INode*) < sizeof (stack));
}
}
}
开发者ID:Hurleyworks,项目名称:newton-dynamics,代码行数:21,代码来源:RigidBodyWorld.cpp
注:本文中的dList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论