Commit Graph

17 Commits

Author SHA1 Message Date
a85c55bbb5 ENH: ensure that content changes in coded objects are noticed (#1293)
- for codedFunctionObject and CodedSource the main code snippets
  were not included in the SHA1 calculation, which meant that many
  changes would not be noticed and no new library would be compiled.

  As a workaround, a dummy 'code' entry could be used solely for the
  purposes of generating a SHA1, but this is easily forgotten.

  We now allow tracking of the dynamicCodeContext for the coded
  objects and append to the SHA1 hasher with specific entries.
  This should solve the previous misbehaviour.

  We additionally add information about the ordering of the code
  sections. Suppose we have a coded function object (all code
  segments are optional) with the following:

      codeExecute "";
      codeWrite   #{ Info<< "Called\n"; #};

  which we subsequently change to this:

      codeExecute #{ Info<< "Called\n"; #};
      codeWrite   "";

  If the code strings are simply concatenated together, the SHA1 hashes
  will be identical. We thus 'salt' with their semantic locations,
  choosing tags that are unlikely to occur within the code strings
  themselves.

- simplify the coded templates with constexpr for the SHA1sum
  information.

- Correct the CodedSource to use 'codeConstrain' instead of
  'codeSetValue' for consistency with the underlying functions.
2019-05-01 14:00:54 +02:00
cd7748f8e4 BUG: bad '#line' directives for dynamicCode (fixes #1282)
- now suppress any '#line' if the input number number is invalid
  (ie, an empty set of tokens)
2019-04-15 12:42:29 +02:00
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
77017e58f4 ENH: support token stream checking to entry (issue #762)
- Eg,
    scalar val(-GREAT);

    const entry* eptr = dict.findEntry(k);

    if (eptr)
    {
        val = eptr.get<scalar>();

        // Or
        eptr.readEntry(val);
    }
2018-10-16 11:13:35 +02:00
c6520033c9 ENH: rationalize dictionary access methods
- use keyType::option enum to consolidate searching options.
  These enumeration names should be more intuitive to use
  and improve code readability.

    Eg,   lookupEntry(key, keyType::REGEX);
    vs    lookupEntry(key, false, true);

  or

    Eg,   lookupEntry(key, keyType::LITERAL_RECURSIVE);
    vs    lookupEntry(key, true, false);

- new findEntry(), findDict(), findScoped() methods with consolidated
  search options for shorter naming and access names more closely
  aligned with other components. Behave simliarly to the
  methods lookupEntryPtr(), subDictPtr(), lookupScopedEntryPtr(),
  respectively. Default search parameters consistent with lookupEntry().

    Eg, const entry* e = dict.findEntry(key);
    vs  const entry* e = dict.lookupEntryPtr(key, false, true);

- added '*' and '->' dereference operators to dictionary searchers.
2018-10-15 16:16:12 +02:00
354bc8bdcb dynamicCode: the "code" entry is now optional
codedFunctionObject: Added the "codeWrite" entry
    for the "write" function for consistency.
    The previous method of using the "code" entry for the "write"
    function was inconsistent and very confusing.
2016-05-18 12:20:03 +01:00
c6c9819249 BUG: dynamicCodeContext: do not add line number to Make/options 2012-06-22 16:42:21 +01:00
289dd8fdc8 Updated header 2012-06-06 21:13:15 +01:00
15fe2b6bf9 dynamicCode: Clang requires line numbers to start from 1 rather than 0 2012-06-06 21:12:58 +01:00
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
8fc5612159 BUG: dynamicCodeContext: preprocessing options_, localCode_ 2011-06-21 11:07:48 +01:00
b9f69cd122 STYLE: Updated GPL 2 -> GPL 3 2011-05-11 11:11:03 +01:00
e7400dba6c ENH: dynamicCodeContext: moved include to after sha1 calculation since adds processor dependency 2011-04-13 15:59:54 +01:00
20b1d49a82 ENH: dynamicCode: display line numbers 2011-03-25 04:43:29 +00:00
cf99e5c800 ENH: codeStream: added codeLibs 2011-03-21 17:54:20 +00:00
e8a3587df4 ENH: support file-scope 'localCode' in dynamicCode 2011-03-08 11:08:42 +01:00
74bc658fe9 ENH: new encapsulation: dynamicCode, dynamicCodeContext
- improve loading/unloading characteristics for codedFixedValue
  but still needs work
2011-02-24 17:14:59 +01:00