Copernicus  2.0
 All Classes Namespaces Files Functions Variables
cpc.server.queue.cmdqueue.CmdQueue Class Reference
Inheritance diagram for cpc.server.queue.cmdqueue.CmdQueue:

Public Member Functions

def getSize
 
def add
 
def remove
 
def get
 
def getUntil
 
def exists
 
def list
 
def deleteByProject
 
def indexOfCommand
 

Public Attributes

 data
 
 queue
 
 lock
 
 inactiveItems
 

Static Public Attributes

int PRIO_LOW_BOUND = -12
 
int PRIO_HIGH_BOUND = 12
 

Member Function Documentation

def cpc.server.queue.cmdqueue.CmdQueue.add (   self,
  command 
)
    description:  puts a command in the queue  
    required: Command:command
    result : command put in queue, queue sorted in priority order of 
     commands, return true
def cpc.server.queue.cmdqueue.CmdQueue.deleteByProject (   self,
  project 
)
Delete all commands related to a project. Returns number of commands
   deleted.
    
   NOTE: this is an O(N) operation for N=number of items in the queue
def cpc.server.queue.cmdqueue.CmdQueue.exists (   self,
  commandID 
)
Check whether commandID exists in the queue. 
   NOTE: this is an O(N) operation for N=number of items in the queue
def cpc.server.queue.cmdqueue.CmdQueue.get (   self)
description: gets a single element with the highest priority from 
    the queue
    result: return Command:command

    alternate result: if no commands in queue return None
def cpc.server.queue.cmdqueue.CmdQueue.getSize (   self)
Count the number of elements in the queue.
def cpc.server.queue.cmdqueue.CmdQueue.getUntil (   self,
  fn,
  parm 
)
Get a number of items from the queue, based on the output of a 
   function (given as parameter).
   fn = the function to test each item with. Should return a tuple of
two booleans: the first decides whether to continue the function
              and the second decides whether to remove the 
              current item from the queue.
   parm = a parameter for the function fn. It will be called with
    fn(parm, queueItem), where queueItem is the queued item
    being looked at.
   returns: the list of items removed from the queue.
def cpc.server.queue.cmdqueue.CmdQueue.indexOfCommand (   self,
  command 
)
def cpc.server.queue.cmdqueue.CmdQueue.list (   self)
Return a list with all active queued items.
def cpc.server.queue.cmdqueue.CmdQueue.remove (   self,
  cmd 
)
Remove a specific command.
   NOTE: this is an O(N) operation for N=number of items in the queue

Member Data Documentation

cpc.server.queue.cmdqueue.CmdQueue.data
cpc.server.queue.cmdqueue.CmdQueue.inactiveItems
cpc.server.queue.cmdqueue.CmdQueue.lock
int cpc.server.queue.cmdqueue.CmdQueue.PRIO_HIGH_BOUND = 12
static
int cpc.server.queue.cmdqueue.CmdQueue.PRIO_LOW_BOUND = -12
static
cpc.server.queue.cmdqueue.CmdQueue.queue

The documentation for this class was generated from the following file: