[root] / trunk / core / base / inc / TQCommand.h Repository:
ViewVC logotype

Log of /trunk/core/base/inc/TQCommand.h

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 43271 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 7 05:53:52 2012 UTC (2 years, 10 months ago) by pcanal
File length: 5468 byte(s)
Diff to previous 39365
Add missing assign operator
Coverity number 35264,35265,35266,35267,35270,35273,35274,35275,
35281,35382,35383,35284,35285,35286,35286,35287,35288,35289,35290,35291,35292,35293,35294
35304,35305,35306,35307,35308,
35356,35371,35372,35378,35379,
35382

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: 5390 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: 5329 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: 5433 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 20877 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 19 11:17:07 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/base/inc/TQCommand.h
File length: 5433 byte(s)
Diff to previous 19826
Set property svn:eol-style LF on all source and Makefiles. This should avoid
problems with Win32 line endings ending up in the repository. All MS tools
support LF eols fine.

Revision 19826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:56:11 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/base/inc/TQCommand.h
File length: 5433 byte(s)
Diff to previous 19825
imported svn:keywords Id property

Revision 19825 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:49:10 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/base/inc/TQCommand.h
File length: 5482 byte(s)
Diff to previous 18024
remove :$ from tag line

Revision 18024 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Feb 19 18:51:48 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/base/inc/TQCommand.h
File length: 5492 byte(s)
Diff to previous 17996
Undo all the changes excluding functions from the abstract interface
to be visible from CINT.
Too many side-effects and not enough energy to solve the problem.
a real pity: we are waisting 1 MByte of real memory with ROOT Core.

Revision 17996 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Feb 18 14:56:42 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/base/inc/TQCommand.h
File length: 5535 byte(s)
Diff to previous 12738
For abstract interfaces, generate the CINT stub functions only for
the strict minimum of functions.
Keep only one pure function known to CINT such that CINT can
recognize that the class is abstract and has pure functions.
This optimization gains about one megabyte of generated code.

Revision 12738 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Sep 18 13:00:04 2005 UTC (9 years, 4 months ago) by rdm
Original Path: trunk/base/inc/TQCommand.h
File length: 5491 byte(s)
Diff to previous 10306
remove another bunch of coding style violations.

Revision 10306 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Oct 13 15:46:37 2004 UTC (10 years, 3 months ago) by rdm
Original Path: trunk/base/inc/TQCommand.h
File length: 5488 byte(s)
Diff to previous 8701
provide the Print(Option_t*,Option_t*) for the TList derived classes that
implement their own Print().

Revision 8701 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Apr 27 07:30:35 2004 UTC (10 years, 8 months ago) by rdm
Original Path: trunk/base/inc/TQCommand.h
File length: 5280 byte(s)
Diff to previous 8695
fix cvs identification string.

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/inc/TQCommand.h
File length: 5259 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.

  Diffs between and
  Type of Diff should be a

Sort log by:

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9