Commits

Anonymous committed 60027db

Initial commit.

Comments (0)

Files changed (6)

RootUtils/InitHist.h

+// This file's extension implies that it's C, but it's really -*- C++ -*-.
+// $Id: InitHist.h,v 1.1 2007-10-07 00:01:54 ssnyder Exp $
+
+/**
+ * @file  RootUtils/InitHist.h
+ * @author scott snyder
+ * @date Oct 2007
+ * @brief Initialize root's getline history.
+ *        You'll need this if you use TTreeViewer using python
+ *        as your interactive shell.  TTreeViewer pushes information
+ *        onto the getline history list.  However, getline is initialized
+ *        only when CINT is used as the shell.  If that isn't the case,
+ *        then such attempts to push to the history will crash.
+ */
+
+#ifndef ROOTUTILS_INITHIST_H
+#define ROOTUTILS_INITHIST_h
+
+
+namespace RootUtils {
+
+
+/**
+ * @brief Initialize root's getline history.
+ */
+class InitHist
+{
+public:
+  /**
+   * @brief Initialize root's getline history.
+   *
+   * This could (almost) just as well be a free function.
+   * The only reason to put it inside a class is that root doesn't
+   * auto-load functions, only classes.
+   */
+  static void Initialize();
+};
+
+
+} // namespace RootUtils
+
+
+#endif // not ROOTUTILS_INITHIST

RootUtils/RootUtilsDict.h

+// This file's extension implies that it's C, but it's really -*- C++ -*-.
+// $Id: RootUtilsDict.h,v 1.1 2007-10-07 00:01:54 ssnyder Exp $
+
+/**
+ * @file  RootUtils/RootUtilsDict.h
+ * @author scott snyder
+ * @date Oct 2007
+ * @brief Dictionary header for RootUtils.
+ */
+
+#include "RootUtils/InitHist.h"

RootUtils/selection.xml

+<lcgdict>
+    <class name="RootUtils::InitHist" />
+</lcgdict>
+package RootUtils
+
+author Scott Snyder <snyder@fnal.gov>
+
+# This shouldn't depend on anything other than root.
+use AtlasPolicy      AtlasPolicy-01-*    
+use AtlasROOT        AtlasROOT-*        External
+use AtlasReflex      AtlasReflex-*      External
+
+apply_pattern installed_library
+library RootUtils  *.cxx
+
+macro_append DOXYGEN_INPUT " ../doc" 
+
+private
+apply_pattern lcgdict dict=RootUtils selectionfile=selection.xml headerfiles="../RootUtils/RootUtilsDict.h"
+
+/**
+
+   \mainpage
+
+This package contains code used to work around various problems
+with root.  It may also contain small pieces of root code of
+general utility.
+
+This package should have no dependencies other than root (and the build
+system).
+
+*/
+// $Id: InitHist.cxx,v 1.1 2007-10-07 00:01:54 ssnyder Exp $
+/**
+ * @file  RootUtils/src/InitHist.cxx
+ * @author scott snyder
+ * @date Oct 2007
+ * @brief Initialize root's getline history.
+ */
+
+#include "RootUtils/InitHist.h"
+#include "Rtypes.h"
+#include "Getline.h"
+
+
+namespace RootUtils {
+
+
+/**
+ * @brief Initialize root's getline history.
+ */
+void InitHist::Initialize()
+{
+  Gl_histinit(const_cast<char*> ("-"));
+}
+
+
+} // namespace RootUtils