• Publicity: Public Only All

callback-procs.tcl

Supports the use of callbacks.

Location:
packages/acs-tcl/tcl/callback-procs.tcl
Author:
Lee Denison <lee@xarg.co.uk>

Procedures in this file

Detailed information

callback::get_object_type_impl (public)

 callback::get_object_type_impl -object_type object_type \
    -callback callback

Finds the most type specific implementation of callback.

Switches:
-object_type (required)
-callback (required)

Partial Call Graph (max 5 caller/called nodes):
%3 acs_object_type::supertypes acs_object_type::supertypes (private) callback::impl_exists callback::impl_exists (public) callback::get_object_type_impl callback::get_object_type_impl callback::get_object_type_impl->acs_object_type::supertypes callback::get_object_type_impl->callback::impl_exists

Testcases:
No testcase defined.

callback::impl_exists (public)

 callback::impl_exists -callback callback -impl impl

Returns whether the specified implementation exists.

Switches:
-callback (required)
-impl (required)

Partial Call Graph (max 5 caller/called nodes):
%3 callback::get_object_type_impl callback::get_object_type_impl (public) callback::impl_exists callback::impl_exists callback::get_object_type_impl->callback::impl_exists packages/search/www/search.tcl packages/search/ www/search.tcl packages/search/www/search.tcl->callback::impl_exists search::indexer search::indexer (private) search::indexer->callback::impl_exists

Testcases:
No testcase defined.
[ hide source ] | [ make this the default ]

Content File Source

ad_library {
    Supports the use of callbacks.

    @author Lee Denison (lee@xarg.co.uk)
}

namespace eval callback {}

d_proc -public callback::impl_exists {
    {-callback:required}
    {-impl:required}
} {
    Returns whether the specified implementation exists.
} {
    return [expr {[namespace which ::callback::${callback}::impl::${impl}] ne ""}]
}

d_proc -public callback::get_object_type_impl {
    {-object_type:required}
    {-callback:required}
} {
    Finds the most type specific implementation of <code>callback</code>.
} {
    if {[callback::impl_exists -callback $callback -impl $object_type]} {
        return $object_type
    } else {
        set supertypes [acs_object_type::supertypes \
            -subtype $object_type]

        foreach type $supertypes {
            if {[callback::impl_exists -callback $callback -impl $type]} {
                return $type
            }
        }
    }

    return ""
}

# Local variables:
#    mode: tcl
#    tcl-indent-level: 4
#    indent-tabs-mode: nil
# End: