LibreOffice Module framework (master) 1
Public Types | Public Member Functions | Private Attributes | List of all members
framework::JobResult Class Referencefinal

represent a result of a finished job execution @descr Such result instance transport all necessary data from the code place where the job was finished to the outside code, where e.g. More...

#include <jobresult.hxx>

Public Types

enum  EParts {
  E_NOPART = 0 ,
  E_ARGUMENTS = 1 ,
  E_DEACTIVATE = 2 ,
  E_DISPATCHRESULT = 4
}
 These enum values are used to build a flag mask of possible set parts of an analyzed pure job execution result. More...
 

Public Member Functions

 JobResult (const css::uno::Any &aResult)
 special ctor @descr It initialize this new instance with a pure job execution result and analyze it. More...
 
 JobResult (const JobResult &rCopy)
 copy dtor More...
 
 ~JobResult ()
 standard dtor @descr Free all internally used resources at the end of living. More...
 
JobResultoperator= (const JobResult &rCopy)
 =operator @descr Must be implemented to overwrite this instance with another one. More...
 
bool existPart (sal_uInt32 eParts) const
 checks for existing parts of the analyzed result @descr The internal flag mask was set after analyzing of the pure result. More...
 
std::vector< css::beans::NamedValue > getArguments () const
 provides access to our internal members @descr The return value will be valid only in case a call of existPart(E_...) before returned true! More...
 
css::frame::DispatchResultEvent getDispatchResult () const
 

Private Attributes

sal_uInt32 m_eParts
 an user of us must know, which (possible) parts of a "pure result" was really set by an executed job. More...
 
std::vector< css::beans::NamedValue > m_lArguments
 a job can have persistent data They are part of the pure result and will be used to write it to the configuration. More...
 
css::frame::DispatchResultEvent m_aDispatchResult
 represent the part "DispatchResult" It's a fulfilled event type, which was given back by the executed job. More...
 

Detailed Description

represent a result of a finished job execution @descr Such result instance transport all necessary data from the code place where the job was finished to the outside code, where e.g.

listener must be notified.

Definition at line 35 of file jobresult.hxx.

Member Enumeration Documentation

◆ EParts

These enum values are used to build a flag mask of possible set parts of an analyzed pure job execution result.

An user of this class can decide, if a member of us can be valid or not. So it can indicate, if a job used the special part inside its returned result protocol. To be usable as flags - it must be values of set {0,1,2,4,8,16 ...}!

Enumerator
E_NOPART 
E_ARGUMENTS 
E_DEACTIVATE 
E_DISPATCHRESULT 

Definition at line 50 of file jobresult.hxx.

Constructor & Destructor Documentation

◆ JobResult() [1/2]

framework::JobResult::JobResult ( const css::uno::Any &  aResult)

special ctor @descr It initialize this new instance with a pure job execution result and analyze it.

Doing so, we update our other members.

It's a list of named values, packed inside this any. Following protocol is used:

  • "SaveArguments" [sequence< css.beans.NamedValue >]
    The returned list of (for this generic implementation unknown!) properties, will be written directly to the configuration and replace any old values there. There will no check for changes and we don't support any merge feature here. They are written only. The job has to modify this list.
  • "SendDispatchResult" [css.frame.DispatchResultEvent]
    The given event is send to all current registered listener. But it's not guaranteed. In case no listener are available or this job isn't part of the dispatch environment (because it was used by the css..task.XJobExecutor->trigger() implementation) this option will be ignored.
  • "Deactivate" [boolean]
    The job wish to be disabled. But note: There is no way, to enable it later again by using this implementation. It can be done by using the configuration only. (Means to register this job again.) If a job knows, that there exist some status or result listener, it must use the options "SendDispatchStatus" and "SendDispatchResult" (see before) too, to inform it about the deactivation of this service.
Parameters
aResultthe job result

an executed job can force his deactivation But we provide this information here only. Doing so is part of any user of us.

Definition at line 72 of file jobresult.cxx.

References framework::JobConst::ANSWER_DEACTIVATE_JOB, framework::JobConst::ANSWER_SAVE_ARGUMENTS, framework::JobConst::ANSWER_SEND_DISPATCHRESULT, E_ARGUMENTS, E_DEACTIVATE, E_DISPATCHRESULT, E_NOPART, comphelper::SequenceAsHashMap::empty(), comphelper::SequenceAsHashMap::end(), comphelper::SequenceAsHashMap::find(), m_aDispatchResult, m_eParts, m_lArguments, and comphelper::sequenceToContainer().

◆ JobResult() [2/2]

framework::JobResult::JobResult ( const JobResult rCopy)

copy dtor

Definition at line 120 of file jobresult.cxx.

References m_aDispatchResult, m_eParts, and m_lArguments.

◆ ~JobResult()

framework::JobResult::~JobResult ( )

standard dtor @descr Free all internally used resources at the end of living.

Definition at line 131 of file jobresult.cxx.

Member Function Documentation

◆ existPart()

bool framework::JobResult::existPart ( sal_uInt32  eParts) const

checks for existing parts of the analyzed result @descr The internal flag mask was set after analyzing of the pure result.

An user of us can check here, if the required part was really part of this result. Otherwise it would use invalid information ... by using our other members!

Parameters
ePartsa flag mask too, which will be compared with our internally set one.
Returns
We return true only, if any set flag of the given mask match.

Definition at line 163 of file jobresult.cxx.

References m_eParts.

◆ getArguments()

std::vector< css::beans::NamedValue > framework::JobResult::getArguments ( ) const

provides access to our internal members @descr The return value will be valid only in case a call of existPart(E_...) before returned true!

Returns
It returns the state of the internal member without any checks!

Definition at line 173 of file jobresult.cxx.

References m_lArguments.

◆ getDispatchResult()

css::frame::DispatchResultEvent framework::JobResult::getDispatchResult ( ) const

Definition at line 175 of file jobresult.cxx.

References m_aDispatchResult.

◆ operator=()

JobResult & framework::JobResult::operator= ( const JobResult rCopy)

=operator @descr Must be implemented to overwrite this instance with another one.

Parameters
rCopyreference to the other instance, which should be used for copying.

Definition at line 143 of file jobresult.cxx.

References m_aDispatchResult, m_eParts, and m_lArguments.

Member Data Documentation

◆ m_aDispatchResult

css::frame::DispatchResultEvent framework::JobResult::m_aDispatchResult
private

represent the part "DispatchResult" It's a fulfilled event type, which was given back by the executed job.

Any user of us can send it to its registered result listener directly.

Definition at line 84 of file jobresult.hxx.

Referenced by getDispatchResult(), JobResult(), and operator=().

◆ m_eParts

sal_uInt32 framework::JobResult::m_eParts
private

an user of us must know, which (possible) parts of a "pure result" was really set by an executed job.

Means which other members of this class are valid. This mask can be used to find it out.

Definition at line 68 of file jobresult.hxx.

Referenced by existPart(), JobResult(), and operator=().

◆ m_lArguments

std::vector< css::beans::NamedValue > framework::JobResult::m_lArguments
private

a job can have persistent data They are part of the pure result and will be used to write it to the configuration.

But that's part of any user of us. We provide this information here only.

Definition at line 76 of file jobresult.hxx.

Referenced by getArguments(), JobResult(), and operator=().


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