Skip to main content
. 2025 Jul 30;25(15):4701. doi: 10.3390/s25154701
Listing 6. Share: definition of Service class.
-- Definition of the Service~class

Service = {}
Service.__index = Service

-- This function implements the constructor of a Service object
function Service:new(pMName, pName, pFunction, pDaemon, pPre)
return setmetatable({
    mName = pMName,      -- Mnemonic name
    name  = pName,      -- MIB
    sFunction = pFunction   -- Service function
    daemon = pDaemon       -- Service daemon
    pre = pPre         -- Pre-conditions
    }, Service)
end