I am iterating history on module level , now is there any way to start iterating history in reverse order like newer changes come first , please suggest me solution. |
Re: Rever order of history
You can put those history entries in a skip list in reverse order:
History h
int count = 0
Skip sk = create()
for h in current Module do put (sk, count--, h)
// iterate them in reverse ...
for h in sk do { print (h.date) }
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Rever order of history Mathias Mamsch - Tue Sep 14 13:55:58 EDT 2010
You can put those history entries in a skip list in reverse order:
History h
int count = 0
Skip sk = create()
for h in current Module do put (sk, count--, h)
// iterate them in reverse ...
for h in sk do { print (h.date) }
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
this will help, but for that I have to put in in skip list before getting the reverse order, so it did too much processing. so is there a way which will help to apply filter on history so that while iterating History on module only those history are iterated which are applicable. Thanks, Hardik Shah |
Re: Rever order of history SystemAdmin - Tue Sep 14 15:27:10 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Rever order of history Mathias Mamsch - Tue Sep 14 16:05:17 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Thanks, Hardik Shah |
Re: Rever order of history SystemAdmin - Wed Sep 15 01:18:16 EDT 2010 If you take a look at the perms list you will find that for the type History you only have the following perms: void ::do (History&, Object, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (History&, SessionObject_, void) V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (History&, SessionModule_, void) V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (History&, Module, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 void ::do (History&, Root__, void) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 SessionObject_ session (Object) V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 SessionModule_ session (Module) V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2 Root__ top (Module) V7.1,V8.0,V8.1,V8.2,V8.3,V9.1-0,V9.2-1,V9.2-2
History h Object obj = current Module mod = current for h in obj do ... for h in session obj do ... // only since V8.1 for h in session mod do ... // only since V8.1 for h in mod do ... for h in top mod do ...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Rever order of history Mathias Mamsch - Tue Sep 14 13:55:58 EDT 2010
You can put those history entries in a skip list in reverse order:
History h
int count = 0
Skip sk = create()
for h in current Module do put (sk, count--, h)
// iterate them in reverse ...
for h in sk do { print (h.date) }
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
You suggested this, it indeed works.
void PrintHist(History hst)
{ if (null hst) print "\tNull Hist\n"
else
{ noError()
print (hst.sessionNo) "\t" (hst.type) "\t[" (hst.attrName) "]\n"
lastError()
}
} // end PrintHist()
Skip skpHist = create()
int Counter = 100
History hst
for hst in (current Object) do
{ PrintHist(hst)
put(skpHist, Counter--, hst)
}
print "************ Reverse *************\n"
for hst in skpHist do
{ PrintHist(hst)
}
delete(skpHist)
|
Re: Rever order of history llandale - Wed Sep 15 17:10:02 EDT 2010 You suggested this, it indeed works.
void PrintHist(History hst)
{ if (null hst) print "\tNull Hist\n"
else
{ noError()
print (hst.sessionNo) "\t" (hst.type) "\t[" (hst.attrName) "]\n"
lastError()
}
} // end PrintHist()
Skip skpHist = create()
int Counter = 100
History hst
for hst in (current Object) do
{ PrintHist(hst)
put(skpHist, Counter--, hst)
}
print "************ Reverse *************\n"
for hst in skpHist do
{ PrintHist(hst)
}
delete(skpHist)
Cite: louie
I am sure that back in v7, it would not work because I discovered that "hst1 = hst2" does not assign a variable value, it creates an alias ...
History h1 = null
History h2 = h1
print "Stack address of h1: " ((addr_ (&h1)) int) "\n"
print "Stack address of h2: " ((addr_ (&h2)) int) "\n"
for h1 in (current Object) do {
print "Turning...\n";
if (!null h2) error "World stopped turning!?"
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Rever order of history Mathias Mamsch - Thu Sep 16 05:26:01 EDT 2010 Cite: louie
I am sure that back in v7, it would not work because I discovered that "hst1 = hst2" does not assign a variable value, it creates an alias ...
History h1 = null
History h2 = h1
print "Stack address of h1: " ((addr_ (&h1)) int) "\n"
print "Stack address of h2: " ((addr_ (&h2)) int) "\n"
for h1 in (current Object) do {
print "Turning...\n";
if (!null h2) error "World stopped turning!?"
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
in v71, my code produces this result:
3173 createObject []
3173 modifyObject [Allocation]
3173 modifyObject [Allocation Rationale]
3173 modifyObject [Behavioral Req]
3173 modifyObject [Classification]
3173 modifyObject [Decomposable]
3173 modifyObject [EDM Req]
3173 modifyObject [Flight Req]
3173 modifyObject [KPP]
3173 modifyObject [Link_SYS]
3173 modifyObject [Object Text]
3173 modifyObject [Rationale]
3173 modifyObject [Required]
3173 modifyObject [Safety Impact]
3173 modifyObject [ShipShore Req]
3173 modifyObject [Target Release]
3173 modifyObject [Verification Level]
3173 modifyObject [Verification Method]
3238 modifyObject [Link_SYS]
3238 modifyObject [Object Text]
************ Reverse *************
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
1 deleteType []
-R-E- DXL: <Line:0> Stack Underflow
Backtrace:
<Line:21>
|