Log of /trunk/core/base/src/TQCommand.cxx
Parent Directory
Revision
39365 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue May 24 19:53:19 2011 UTC (3 years, 8 months ago) by
pcanal
File length: 36462 byte(s)
Diff to
previous 25128
Remove hard dependencies of TFileMerger on TH1 and TTree.
(Soft dependencies still exist to be able to disable the
merging of TTrees and to be able to disable the AutoAdd
behavior of TH1).
Introduce new explicit interface for providing merging
capability. If a class has a method with the name and
signature:
Long64_t Merge(TCollection *input, TFileMergeInfo*);
it will be used by a TFileMerger to merge one or more
other objects into the current object. Merge should
return a negative value if the merging failed.
If this method does not exist, the TFileMerger will use
a method with the name and signature:
Long64_t Merge(TColletion *input);
TClass now provides a quick access to these merging
function via TClass::GetMerge. The wrapper function
is automatically created by rootcint and can be installed
via TClass::SetMerge. The wrapper function should have
the signature/type ROOT::MergeFunc_t:
Long64_t (*)(void *thisobj, TCollection *input, TFileMergeInfo*);
Added the new Merge function to TTree and THStack.
Also add the new Merge function to TQCommand as the
existing TQCommand::Merge does _not_ have the right
semantic (in part because TQCommand is a collection).
Fix the return value of TEfficiency::Merge
In TFileMerger, add a PrintLevel to allow hadd to request
more output than regular TFileMerger.
The object TFileMergeInfo can be used inside the Merge
function to pass information between runs of the Merge
(see below). In particular it contains:
TDirectory *fOutputDirectory; // Target directory where the merged object will be written.
Bool_t fIsFirst; // True if this is the first call to Merge for this series of object.
TString fOptions; // Additional text based option being passed down to customize the merge.
TObject *fUserData; // Place holder to pass extra information. This object will be deleted at the end of each series of objects.
The default in TFileMerger is to call Merge for every object
in the series (i.e the collection has exactly one element) in
order to save memory (by not having all the object in memory
at the same time).
However for histograms, the default is to first load all the
objects and then merge them in one go ; this is customizable
when creating the TFileMerger object.
Revision
25128 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Aug 12 17:59:19 2008 UTC (6 years, 5 months ago) by
pcanal
File length: 35924 byte(s)
Diff to
previous 22961
From Matevz:
* TCollection:
Replace Print() methods
virtual void Print(Option_t *wildcard="") const;
virtual void Print(Option_t *wildcard, Option_t *option) const;
with --------------------------------------------------
virtual void Print(Option_t *option="") const;
virtual void Print(Option_t *option, Int_t recurse) const;
virtual void Print(Option_t *option, const char* wildcard,
Int_t recurse=1) const;
virtual void Print(Option_t *option, TPRegexp& regexp,
Int_t recurse=1) const;
Introduce three new protected methods used to print out collection details.
These are called from the Print() methods and make overriding of what
is printed for a collection / entries easier.
virtual void PrintCollectionHeader(Option_t* option) const;
virtual const char* GetCollectionEntryName(TObject* entry) const;
virtual void PrintCollectionEntry(TObject* entry, Option_t* option,
Int_t recurse) const;
* TMap:
Remove two overloaded Print() methods, implement protected
PrintCollectionEntry() instead.
* TQCommand, TQUndoManager, TQConnection, TQConnectionList
Remove overriden Print() methods. If needed, override
PrintCollectionHeader() or PrintCollectionEntry() instead.
* TAlienJobStatusList
Remove Print(), implement PrintCollectionEntry() instead.
* TAlienResult
Remove overloaded Print(wildcard, option) which no longer exists.
* test/tcollprint.cxx
New file - demonstrates behaviour of Print() methods for TList and TMap.
Revision
22961 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Apr 3 13:32:57 2008 UTC (6 years, 9 months ago) by
rdm
File length: 35613 byte(s)
Diff to
previous 20877
move the directories:
base clib cont meta metautils newdelete pcre rint thread unix utils
winnt zip
under the new core meta directory.
Revision
17412 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 20 19:29:35 2007 UTC (8 years ago) by
brun
Original Path:
trunk/base/src/TQCommand.cxx
File length: 35676 byte(s)
Diff to
previous 14336
-Remove Varargs.h from TString.h and TObject.h and add this include
in the few files that need it.
-Move the following enums from TBuffer.h to TBufferFile.h
enum { kMapSize = 503 };
enum { kStreamedMemberWise = BIT(14) }; //added to version number to know if a collection has been stored member-wise
enum { kNotDecompressed = BIT(15) }; //indicates a weird buffer, used by TBasket
enum { kCannotHandleMemberWiseStreaming = BIT(17), //if set TClonesArray should not use memeber wise streaming
kTextBasedStreaming = BIT(18) }; // indicates if buffer used for XML/SQL object streaming
Revision
14336 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 20 21:43:44 2006 UTC (8 years, 10 months ago) by
pcanal
Original Path:
trunk/base/src/TQCommand.cxx
File length: 35655 byte(s)
Diff to
previous 13258
Reduce direct dependencies on TClass.h, TROOT.h and TStreamerInfo.h.
Warning: This means that some file that relied on the indirect
inclusion of these header file might now fail to compile with
an error message mention that gROOT is no known or that TClass,
TROOT or TStreamerInfo is incompletely defined. Simply add the
proper include directive.
Revision
8695 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Added
Mon Apr 26 16:45:38 2004 UTC (10 years, 9 months ago) by
brun
Original Path:
trunk/base/src/TQCommand.cxx
File length: 35548 byte(s)
From Valeriy Onuchin:
- new classes TQCommand, TQUndoManager are introduced.
These classes are supposed to be used in WYSWYG editors like ged and gui builder.
The implementation is based on the command design pattern.
The Command design pattern is based on the idea, that all editing
in an application is done by creating instances of command objects.
Command objects apply changes to the edited object and then are
stored on a command stack. Furthermore, each command knows how to
undo its changes to bring the edited object back to its previous
state. As long as the application only uses command objects to
change the state of the edited object, it is possible to undo
a sequence of commands by traversing the command stack downwards and
calling the "undo" method of each command in turn. It is also
possible to redo a sequence of commands by traversing the command
stack upwards and calling the "redo" method of each command.
Examples:
1. Create a new command
TQCommand *com = new TQCommand("TH1", hpx, "SetFillColor(Color_t)"
"SetFillColor(Color_t)");
1st parameter - the name of class
2nd parameter - object
3rd parameter - the name of do/redo method
4th parameter - the name of undo method
Since redo,undo methods in this example are the same, undo name can be omitted, e.g.
TQCommand *com = new TQCommand("TH1", hpx, "SetFillColor(Color_t)");
For objects derived from TObject class name can be omitted, e.g.
TQCommand *com = new TQCommand(hpx, "SetFillColor(Color_t)");
2. Setting undo, redo parameters.
Color_t old_color = hpx->GetFillColor();
Color_t new_color = 4; // blue color
com->SetRedoArgs(1, new_color);
com->SetUndoArgs(1, old_color);
1st argument - the number of undo, redo parameters
the other arguments - undo, redo values
Since the number of undo,redo parameters is the same one can use
com->SetArgs(1, new_color, old_color);
3. Undo, redo method execution
com->Redo(); // execute redo method
com->Undo(); // execute undo method
4. Merged commands
It possible to group several commands together so an end user
can undo and redo them with one command.
TQCommand *update = new TQCommand(gPad, "Modified()");
// add update command to "SetFillColor" command
com->Add(update);
5. Macro commands
"Merging" allows to create macro commands, e.g.
TQCommand *macro = new TQCommand("my macro");
macro->Add(com1);
macro->Add(com2);
...
During Redo operation commands composing macro command are executed
sequentially in direct order (first in first out). During Undo,
they are executed in reverse order (last in first out).
6. Undo manager.
TQUndoManager is recorder of undo and redo operations. This is
command history list which can be traversed backwards and upwards
performing undo and redo operations.
To register command TQUndoManager::Add(TObject*) method is used.
TQUndoManager *history = new TQUndoManager();
history->Add(com);
TQUndoManager::Add automatically invokes execution of command's
Redo method.
Use TQUndoManager::Undo to undo commands in history list.
Redo is Undo for undo action. Use TQUndoManager::Redo method for that.
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.