/* * Created by PyramIDE. * User: Totoro * Date: 16/11/2011 * Time: 23:53 */ read tools/basis.anubis read calexium_lib/database/vtm/view_table_types.anubis read calexium_lib/database/vtm/view_table_manager_types.anubis public define Maybe(VTM_view) _vtm_get_view ( String table_name, List(VTM_view) list ) = if list is { [] then println("_vtm_get_view "+table_name+" not found"); failure, [ h . t ] then if h is vtm_view(tb_name, get_view) then if tb_name = table_name then success(h) else _vtm_get_view(table_name, t) }. public define Maybe(VTM_view) vtm_get_view ( String table_name, VTM_view_list vtm_vlist ) = _vtm_get_view(table_name, vtm_vlist.list). public define Maybe(VTM_edit) _vtm_get_edit ( String table_name, List(VTM_edit) list ) = if list is { [] then failure, [ h . t ] then if h is vtm_edit(tb_name, get_edit) then if tb_name = table_name then success(h) else _vtm_get_edit(table_name, t) }. public define Maybe(VTM_edit) vtm_get_edit ( String table_name, VTM_edit_list vtm_vlist ) = _vtm_get_edit(table_name, vtm_vlist.list). public define Maybe(TM_writer) _tm_get_writer ( String table_name, List(TM_writer) list ) = if list is { [] then failure, [ h . t ] then if h is tm_writer(tb_name, get_writer) then if tb_name = table_name then success(h) else _tm_get_writer(table_name, t) }. public define Maybe(TM_writer) tm_get_writer ( String table_name, TM_writer_list tm_wlist ) = _tm_get_writer(table_name, tm_wlist.list).