Initial implementation of lua classes to handle pools and interface pools

This commit is contained in:
Simone Mainardi 2020-07-05 12:15:08 +02:00
parent fdb486e088
commit a9040f1057
2 changed files with 100 additions and 0 deletions

View file

@ -8,6 +8,26 @@ local interface_pools = {}
-- ##############################################
function interface_pools:create(name, members, configset_id)
-- Instance of the base class
local _interface_pools = base_pools:create()
-- Subclass using the base class instance
local _interface_pools_instance = _interface_pools:create({key = "interface", name = name or '', members = members or {}, configset_id = configset_id or 0})
-- In the instance has been created successfully, we can persist it
if _interface_pools_instance then
if not _interface_pools_instance:_persist() then
-- Failed to persist the instance, unable to create
return nil
end
end
-- Return the instance
return _interface_pools_instance
end
-- ##############################################
-- @brief Returns members which doesn't belong to any pool
function interface_pools.list_available_members()
-- STUB: currently returns all members