Arcades

Class ArcadesComponent

Base of any ARCADES related object.

ArcadesComponent is a base class for any ARCADES class, providing default behavior for logging, string representation, dumping and loading.

Info:
  • Dump

    Serializable dump of an object.

    Todo:
    • Complete doc
  • InitArgument

    Arguments used to instanciate a new object.

    Todo:
    • Complete doc
  • table

    _args

    Table (shallow copy) of arguments used for instanciation

  • utils.Logger

    _logger

    Object's logger

    See also:
  • string

    _name

    Identifier name of the object

  • table

    _no_dump_list

    List of attributes that does not need to be dumped

  • __init ( args, dump )

    Object constructor.

    Instanciate a new ARCADES object.

    Parameters:
    • InitArgument args
      Table of attributes/arguments to pass to the object
    • Dump dump
      Dump of an object to re-instanciate
  • __tostring__ ()

    Get a string representation of the object.

    Returns:
    • string A string representing the object

Public Methods

keyboard_arrow_up
  • dump ( [cycles={}] )

    Dump an object.

    Build a serializable table containing enough information to instanciate and initialize a new object at the same state than self.

    Parameters:
    • table cycles
      Already dumped fields to avoid loops (default {})
    Returns:
    • Dump A serializable table
  • load ( dump )

    Load an object from a dump.

    Given a dump, find the associated class, instanciate an object and initialize it.

    Parameters:
    • Dump dump
      Dump to restore
    Returns:
    • A newly instanciated object

Static Functions

keyboard_arrow_up
  • _dump ( [o[, cycles={}]] )

    Dump an object.

    Dump any object, avoiding cycles. The dump will contain any attribute excepted:

    • functions
    • attributes with name starting with _ (underscore)
    • attributes with name present in _no_dump_list

    If possible, tables and objects will be recurcively dumped.

    Parameters:
    • o
      Object to dump (optional)
    • table cycles
      Already dumped tables/objects (default {})
    Returns:
    • table or nil A serializable table