Did you know ... Search Documentation:
Pack nan_system_sources -- prolog/nan/system/sources_system.pl
PublicShow source

Part of Nan.System.Sources (nan/system/sources.pl)

Module sources_system (nan/system/sources_system.pl) provides system-level support predicates.

For code docs syntax and meaning see sources_docs.txt.

NOTE:

  • This module is meant for internal use only.
author
- Julio P. Di Egidio
version
- 1.2.0-beta
license
- GNU GPLv3
To be done
- Add stack trace in debug mode.
- Remove logging calls with source_debug(false).
 source_typ_sid(+Src:source, -Typ:source_typ, -Sid:source_sid) is det
source_typ_sid(-Src:source, -Typ:source_typ, +Sid:source_sid) is det
Converts between a source reference and an internal sid.
Arguments:
Src- The source reference.
Typ- The source type (one of t0 or t1).
Sid- The source internal sid.
 source_new_sid(+Typ:source_typ, -Sid:source_sid) is det
Generates a new internal sid given a source type.
Arguments:
Typ- The source type (one of t0 or t1).
Sid- The source internal sid.
 source_db_exists(+Sid:source_sid) is semidet
Tests that a record exists for a source.
Arguments:
Sid- The source internal sid.
 source_db_enum(?Sid:source_sid, ?Term:any) is nondet
Enumerates all recorded sources and corresponding terms.
Arguments:
Sid- The source internal sid.
Term- The source's recorded term.
 source_db_get(+Sid:source_sid, +Cat:atom, -Term:any) is det
Gets the recorded term of a source.
Arguments:
Sid- The source internal sid.
Cat- The caller's category.
Term- The source's recorded term.
throws
- source_error(db_does_not_exist(Sid, Cat))
 source_db_add(+Sid:source_sid, +Cat:atom, +Term:any) is det
Adds the recorded term for a source.
Arguments:
Sid- The source internal sid.
Cat- The caller's category.
Term- The source's recorded term.
throws
- source_error(db_exists_already(Sid, Cat))
 source_db_del(+Sid:source_sid, +Cat:atom) is det
Deletes the recorded term of a source.
Arguments:
Sid- The source internal sid.
Cat- The caller's category.
throws
- source_error(db_does_not_exist(Sid, Cat))
 source_catch(:Goal:callable, -Res) is det
Calls a goal with catch/3 and returns a result term.
  • Goal invoked as Goal() is nondet.
Arguments:
Goal- The goal to catch.
Res- The result of the call.
 source_throw(+EMsg:callable) is det
Throws a source error for a message term.

The error term has the form source_error(EMsg, _).

Arguments:
EMsg- The error message.
 source_rethrow(+Ress:list) is det
Possibly throws a combined source error for a list of goal results.

Depending on the list of results, the possible cases are:

  • No errors: does not trow (succeeds).
  • A single error: rethrows the error.
  • Multiple errors: throws a combined source error.

A combined source error term has the form source_error(many_errors(Errs), _) where Errs is a list of all error terms found in the results.

Arguments:
Ress- The list of goal results.
 source_has_err(+Res) is semidet
Tests if a source result indicates an error.
Arguments:
Res- The goal result.
 source_log_call(+Sid:source_sid, +Cat:atom, +Act:atom) is det
Prints an informational message before or after a call.

The message term has the form sources__log(Tm, Sid, Cat, Fmt, Args).

Arguments:
Sid- The source internal sid.
Cat- The caller's category.
Act- The caller's action (one of start or end).
 source_log_msg(+Sid:source_sid, +Cat:atom, +Act:atom, +Msg:text) is det
Prints an informational message about a source messaging.

The message term has the form sources__log(Tm, Sid, Cat, Fmt, Args).

Arguments:
Sid- The source internal sid.
Cat- The caller's category.
Act- The caller's action (one of send or recv).
Msg- The caller's message.
 source_log(+Sid:source_sid, +Cat:atom, +Fmt:text, +Args:list) is det
Prints an informational message.

The message term has the form sources__log(Tm, Sid, Cat, Fmt, Args).

Arguments:
Sid- The source internal sid.
Cat- The caller's category.
Fmt- The caller's format.
Args- The caller's arguments.