Jul.07.2018 -- CAlive to introduce reference__*() functions

9 views
Skip to first unread message

Rick C. Hodgin

unread,
Jul 7, 2018, 7:15:23 AM7/7/18
to caliveprogra...@googlegroups.com
CAlive will introduce reference__*() functions for named types, allowing each type referenced in code to make a transparent call to the named function, allowing for debugging.  A nearby [|hash|name/value||] cask can be added to indicate the hash value of that particular instance.  It includes the source file the reference came from (fully qualified path), the minimal source file name, and an optional hash name if the [|define|] cask.  These can be used to hone in on specific instances, and let the rest pass silently thru.

    function reference__s8
    | params s8& v, datum source_filepath, datum source_file, s32 line, hash name
    {
        // Add your custom code here to examine this information
        switch (name)
        {
            case [|hash|debug||]:
                // Process this here
                break;

            case [|hash|validate not null||]:
                // Process this here
                break;

            case [|hash|validate has valid prev member||]:
                // Process this here
                break;

            case [|hash|validate has valid next member||]:
                // Process this here
                break;

            case [|hash|validate has parent||]:
                // Process this here
                break;
        }
    }

This will work for custom types, anything that can be referenced in CAlive can pass thru these functions so they can be examined by use instances with their runtime values.

This may greatly slow down processing.  The feature is added for its debugging utility.

-- 
Rick C. Hodgin

Reply all
Reply to author
Forward
0 new messages