Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gen_gtest_pred_impl Namespace Reference

Functions

def HeaderPreamble
 
def Arity
 
def Title
 
def OneTo
 
def Iter
 
def ImplementationForArity
 
def HeaderPostamble
 
def GenerateFile
 
def GenerateHeader
 
def UnitTestPreamble
 
def TestsForArity
 
def UnitTestPostamble
 
def GenerateUnitTest
 
def _Main
 

Variables

string __author__ 'wan@google.com (Zhanyong Wan)'
 
tuple SCRIPT_DIR os.path.dirname(sys.argv[0])
 
tuple HEADER os.path.join(SCRIPT_DIR, '../include/gtest/gtest_pred_impl.h')
 
tuple UNIT_TEST os.path.join(SCRIPT_DIR, '../test/gtest_pred_impl_unittest.cc')
 

Function Documentation

def gen_gtest_pred_impl._Main ( )
private
The entry point of the script.  Generates the header file and its
unit test.

Definition at line 715 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 715 of file gen_gtest_pred_impl.py

References GenerateHeader(), and GenerateUnitTest().

+ Here is the call graph for this function:

def gen_gtest_pred_impl.Arity (   n)
Returns the English name of the given arity.

Definition at line 164 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 164 of file gen_gtest_pred_impl.py

Referenced by ImplementationForArity(), and TestsForArity().

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.GenerateFile (   path,
  content 
)
Given a file path and a content string, overwrites it with the
given content.

Definition at line 302 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 302 of file gen_gtest_pred_impl.py

References file.

Referenced by GenerateHeader(), and GenerateUnitTest().

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.GenerateHeader (   n)
Given the maximum arity n, updates the header file that implements
the predicate assertions.

Definition at line 315 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 315 of file gen_gtest_pred_impl.py

References GenerateFile(), HeaderPostamble(), HeaderPreamble(), ImplementationForArity(), join(), and OneTo().

Referenced by _Main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.GenerateUnitTest (   n)
Returns the tests for up-to n-ary predicate assertions.

Definition at line 706 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 706 of file gen_gtest_pred_impl.py

References GenerateFile(), join(), OneTo(), TestsForArity(), UnitTestPostamble(), and UnitTestPreamble().

Referenced by _Main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.HeaderPostamble ( )
Returns the postamble for the header file.

Definition at line 293 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 293 of file gen_gtest_pred_impl.py

Referenced by GenerateHeader().

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.HeaderPreamble (   n)
Returns the preamble for the header file.

Args:
  n:  the maximum arity of the predicate macros to be generated.

Definition at line 65 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 65 of file gen_gtest_pred_impl.py

Referenced by GenerateHeader().

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.ImplementationForArity (   n)
Returns the implementation of n-ary predicate assertions.

Definition at line 205 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 205 of file gen_gtest_pred_impl.py

References Arity(), Iter(), str, and Title().

Referenced by GenerateHeader().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.Iter (   n,
  format,
  sep = '' 
)
Given a positive integer n, a format string that contains 0 or
more '%s' format specs, and optionally a separator string, returns
the join of n strings, each formatted with the format string on an
iterator ranged from 1 to n.

Example:

Iter(3, 'v%s', sep=', ') returns 'v1, v2, v3'.

Definition at line 189 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 189 of file gen_gtest_pred_impl.py

References OneTo().

Referenced by testing::internal.ArrayAwareFind(), SvtxEvaluatorHaiwang.fillOutputNtuples(), psTOFTimezeroEval.fillOutputNtuples(), ImplementationForArity(), testing::internal.LogElementMatcherPairVec(), psTOFTimezeroEval.printInputInfo(), SvtxEvaluatorHaiwang.printInputInfo(), psTOFTimezeroEval.printOutputInfo(), SvtxEvaluatorHaiwang.printOutputInfo(), HFMLTriggerOccupancy.process_event(), TPCDataStreamEmulator.process_event(), HFMLTriggerInterface.process_event(), AnaMvtxTelescopeHits.process_event(), and TestsForArity().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.OneTo (   n)
Returns the list [1, 2, 3, ..., n].

Definition at line 183 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 183 of file gen_gtest_pred_impl.py

Referenced by GenerateHeader(), GenerateUnitTest(), Iter(), and TestsForArity().

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.TestsForArity (   n)
Returns the tests for n-ary predicate assertions.

Definition at line 411 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 411 of file gen_gtest_pred_impl.py

References Arity(), Iter(), join(), OneTo(), and Title().

Referenced by GenerateUnitTest().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.Title (   word)
Returns the given word in title case.  The difference between
this and string's title() method is that Title('4-ary') is '4-ary'
while '4-ary'.title() is '4-Ary'.

Definition at line 175 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 175 of file gen_gtest_pred_impl.py

References test_detectors.upper.

Referenced by DataAna(), DataAna2(), EnergyGlance(), ImplementationForArity(), and TestsForArity().

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.UnitTestPostamble ( )
Returns the postamble for the tests.

Definition at line 700 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 700 of file gen_gtest_pred_impl.py

Referenced by GenerateUnitTest().

+ Here is the caller graph for this function:

def gen_gtest_pred_impl.UnitTestPreamble ( )
Returns the preamble for the unit test file.

Definition at line 325 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 325 of file gen_gtest_pred_impl.py

Referenced by GenerateUnitTest().

+ Here is the caller graph for this function:

Variable Documentation

string gen_gtest_pred_impl.__author__ 'wan@google.com (Zhanyong Wan)'

Definition at line 49 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 49 of file gen_gtest_pred_impl.py

tuple gen_gtest_pred_impl.HEADER os.path.join(SCRIPT_DIR, '../include/gtest/gtest_pred_impl.h')

Definition at line 59 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 59 of file gen_gtest_pred_impl.py

tuple gen_gtest_pred_impl.SCRIPT_DIR os.path.dirname(sys.argv[0])

Definition at line 56 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 56 of file gen_gtest_pred_impl.py

tuple gen_gtest_pred_impl.UNIT_TEST os.path.join(SCRIPT_DIR, '../test/gtest_pred_impl_unittest.cc')

Definition at line 62 of file gen_gtest_pred_impl.py.

View newest version in sPHENIX GitHub at line 62 of file gen_gtest_pred_impl.py