class multiprocess_mode

Enumeration class describing the multiprocess mode of a CodeSonar analysis process.

analysis.get_multiprocess_mode() returns an object of this class.

See Parallelism in CodeSonar: Analysis for more information about multiprocess modes.

multiprocess_mode Details

class cs.multiprocess_mode

Enumeration class describing the multiprocess mode of a CodeSonar analysis process.

static from_integer(_inner)

Construct an instance from an integer representation.

Parameters:_inner (int) – The integer representation, as returned by multiprocess_mode.as_integer().
Return type:multiprocess_mode
Raises:result.ERROR_INVALID_ARGUMENT if _inner is not a valid integer representation for a multiprocess_mode instance.

Invariant: For multiprocess_mode x, multiprocess_mode.from_integer(x.as_integer()) == x

>>> multiprocess_mode.from_integer(1)
<cs.multiprocess_mode serial>
__cmp__(other)

Comparison function for multiprocess_mode , with respect to a stable overall ordering.

Parameters:other (multiprocess_mode) – The multiprocess_mode object to compare against.
Return type:int
Returns:An integer N such that:
  • N==0 if the two objects compare equal
  • N<0 if self < other
  • N>0 if self > other
>>> multiprocess_mode.INITIALIZING.__cmp__(multiprocess_mode.MASTER)
-1
__eq__(b)

Equality operator for multiprocess_mode .

Parameters:b (multiprocess_mode) – The multiprocess_mode object to compare against.
Return type:bool
Returns:True if self and b compare equal, False otherwise.
>>> multiprocess_mode.SLAVE == multiprocess_mode.SLAVE
True
__ge__(b)

Greater-than-or-equal operator for multiprocess_mode .

Parameters:b (multiprocess_mode) – The multiprocess_mode object to compare against.
Return type:bool
Returns:True if self >= b , False otherwise.
>>> multiprocess_mode.SERIAL >= multiprocess_mode.MASTER
False
__gt__(b)

Greater-than operator for multiprocess_mode .

Parameters:b (multiprocess_mode) – The multiprocess_mode object to compare against.
Return type:bool
Returns:True if self > b , False otherwise.
>>> multiprocess_mode.INITIALIZING > multiprocess_mode.INITIALIZING
False
__hash__()

Hash function for multiprocess_mode .

Return type:int
>>> hash(multiprocess_mode.MASTER)
2
__le__(b)

Less-than-or-equal operator for multiprocess_mode .

Parameters:b (multiprocess_mode) – The multiprocess_mode object to compare against.
Return type:bool
Returns:True if self <= b , False otherwise.
>>> multiprocess_mode.SERIAL <= multiprocess_mode.SLAVE
True
__lt__(b)

Less-than operator for multiprocess_mode .

Parameters:b (multiprocess_mode) – The multiprocess_mode object to compare against.
Return type:bool
Returns:True if self < b , False otherwise.
>>> multiprocess_mode.MASTER < multiprocess_mode.SERIAL
False
__ne__(b)

Inequality operator for multiprocess_mode .

Parameters:b (multiprocess_mode) – The multiprocess_mode object to compare against.
Return type:bool
Returns:False if self and b compare equal, True otherwise.
>>> multiprocess_mode.INITIALIZING != multiprocess_mode.SLAVE
True
__repr__()

Get a representation of a multiprocess_mode object that includes information useful for debugging.

Return type:str
Returns:The string representation.
>>> repr(multiprocess_mode.SERIAL)
'<cs.multiprocess_mode serial>'
__str__()

Get a simple string representation of a multiprocess_mode object.

Return type:str
Returns:The string representation.
>>> str(multiprocess_mode.MASTER)
'master'
as_integer()

Get an integer representation of self.

Return type:int
Returns:An integer suitable for use with multiprocess_mode.from_integer().

Invariant: For multiprocess_mode x, multiprocess_mode.from_integer(x.as_integer()) == x

>>> multiprocess_mode.INITIALIZING.as_integer()
0
name()

Get the name of a multiprocess_mode object.

Return type:str
Returns:The name.
>>> multiprocess_mode.INITIALIZING.name()
'initializing'
DEEP_PARSE_MASTER
>>> multiprocess_mode.DEEP_PARSE_MASTER
<cs.multiprocess_mode master>
INITIALIZING

Every CodeSonar process always starts in this state.

If this value is returned by analysis.get_multiprocess_mode(), it means that the function call occurred too early to get useful information.

>>> multiprocess_mode.INITIALIZING
<cs.multiprocess_mode initializing>
MASTER

Indicates that CodeSonar is running in parallel mode, and the current process is the analysis master or daemon master.

>>> multiprocess_mode.MASTER
<cs.multiprocess_mode master>
SERIAL

Indicates that CodeSonar is running in serial mode (and therefore there is only one analysis process - the current one).

>>> multiprocess_mode.SERIAL
<cs.multiprocess_mode serial>
SLAVE

Indicates that CodeSonar is running in parallel mode, and the current process is an analysis slave or daemon slave.

>>> multiprocess_mode.SLAVE
<cs.multiprocess_mode slave>