KFbxUserNotification Class Reference

#include <kfbxusernotification.h>

List of all members.


Detailed Description

This class accumulates user notifications and sends them to any device opened by the derived classes.

If this class is not derived, the data can only be sent to a log file. To send data to a log file, it must be opened before attempting to send data, otherwise, the messages will be lost.

Definition at line 138 of file kfbxusernotification.h.


Accumulator Output

enum   OutputSource {
   eACCUMULATOR_ENTRY,
   eSEQUENCED_DETAILS
}
 
  • eACCUMULATOR_ENTRY
    • eSEQUENCED_DETAILS
More...
bool  Output (OutputSource pOutSrc=eACCUMULATOR_ENTRY, int pIndex=-1, bool pExtraDevicesOnly=false)
  Send the accumulator entries to the output devices.
bool  OutputById (AEid pId, OutputSource pOutSrc=eACCUMULATOR_ENTRY, bool pExtraDevicesOnly=false)
  Send the accumulator entry to the output devices.
bool  Output (const KString &pName, const KString &pDescr, AccumulatorEntry::AEClass pClass, bool pExtraDevicesOnly=false)
  Send an immediate entry to the output devices.
bool  Output (KFbxUserNotificationFilteredIterator &pAEFIter, bool pExtraDevicesOnly=false)
  Sends the content of the iterator to the output devices.
void  SetLogMessageEmitter (KFbxMessageEmitter *pLogMessageEmitter)
  Set log message emitter.

Public Types

enum   AEid {
   eBINDPOSE_INVALIDOBJECT = 0x0000,
   eBINDPOSE_INVALIDROOT,
   eBINDPOSE_NOTALLANCESTORS_NODES,
   eBINDPOSE_NOTALLDEFORMING_NODES,
   eBINDPOSE_NOTALLANCESTORS_DEFNODES,
   eBINDPOSE_RELATIVEMATRIX,
   eFILE_IO_NOTIFICATION,
   eFILE_IO_NOTIFICATION_MATERIAL,
   eFILE_IO_NOTIFICATION_DXF_NOT_SUPPORT_NURBS,
   eAE_START_ID
}
 
  • eBINDPOSE_INVALIDOBJECT
    • eBINDPOSE_INVALIDROOT
    • eBINDPOSE_NOTALLANCESTORS_NODES
    • eBINDPOSE_NOTALLDEFORMING_NODES
    • eBINDPOSE_NOTALLANCESTORS_DEFNODES
    • eBINDPOSE_RELATIVEMATRIX
    • eFILE_IO_NOTIFICATION
    • eFILE_IO_NOTIFICATION_MATERIAL
    • eFILE_IO_NOTIFICATION_DXF_NOT_SUPPORT_NURBS
    • eAE_START_ID
More...

Public Member Functions

  KFbxUserNotification (KFbxSdkManager *pManager, KString const &pLogFileName, KString const &pSessionDescription)
  Instantiate a KFbxUserNotification but leave it uninitialized.
virtual  ~KFbxUserNotification ()
  Destructor.
void  InitAccumulator ()
  This method must be called before using the Accumulator.
void  ClearAccumulator ()
  This method must be called when the Accumulator is no longer needed.
Accumulator Management
int  AddEntry (const int pID, const KString &pName, const KString &pDescr, AccumulatorEntry::AEClass pClass=AccumulatorEntry::eAE_WARNING)
  Adds one entry into the accumulator.
int  AddDetail (int pEntryId)
  Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events.
int  AddDetail (int pEntryId, KString pString)
  Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events.
int  AddDetail (int pEntryId, KFbxNode *pNode)
  Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events.
int  GetNbEntries () const
  Returns the number of AccumulatorEntries currently stored in this accumulator.
const AccumulatorEntry GetEntry (int pEntryId) const
  Get the specified AccumulatorEntry.
const AccumulatorEntry GetEntryAt (int pEntryIndex) const
  Get the AccumulatorEntry at the specified index.
int  GetNbDetails () const
  Returns the number of Details recorded so far in this accumulator.
int  GetDetail (int pDetailId, const AccumulatorEntry *&pAE) const
  Get the specified detail.
Utilities
virtual void  GetLogFilePath (KString &pPath)
  Returns the absolute path to the log file.
KString  GetLogFileName ()
  Returns the log file name.

Static Public Member Functions

static KFbxUserNotification Create (KFbxSdkManager *pManager, const KString &pLogFileName, const KString &pSessionDescription)
static void  Destroy (KFbxSdkManager *pManager)

Protected Member Functions

virtual bool  PostTerminate ()
  Allow a derived class to finalize processing AFTER the log file handle has been deleted.
virtual void  AccumulatorInit ()
  Allow the implementation class to perform accumulator initializations before the Extra devices are opened.
virtual void  AccumulatorClear ()
  Allow the implementation class to perform accumulator clear after the Extra devices are closed.
virtual void  OpenExtraDevices ()
  Allow the implementation class to opens its output devices (called by InitAccumulator).
virtual bool  SendToExtraDevices (bool pOutputNow, KArrayTemplate< AccumulatorEntry * > &pEntries)
  Allow the implementation class to send all the accumulator entries to the devices.
virtual bool  SendToExtraDevices (bool pOutputNow, KArrayTemplate< AESequence * > &pAESequence)
  Allow the implementation class to send all the accumulator entries to the devices.
virtual bool  SendToExtraDevices (bool pOutputNow, const AccumulatorEntry *pAccEntry, int pDetailId=-1)
  Allow the implementation class to send one accumulator entry to the devices.
virtual void  CloseExtraDevices ()
  Allow the implementation class to close it's output devices (called in the ClearAccumulator) By default this method does nothing.
void  ResetAccumulator ()
  Clears the Accumulator list.
void  ResetSequence ()
  Clears the Sequence list.
void  SendToLog (OutputSource pOutSrc, int pId)
  Send the pIdth element of the accumulator or sequence list to the log file.
void  SendToLog (const AccumulatorEntry *pAccEntry, int pDetailId=-1)
  Send the accumulator entry to the log file.

Friends

class  KFbxUserNotificationFilteredIterator

Classes

class   AESequence

Member Enumeration Documentation

enum AEid
  • eBINDPOSE_INVALIDOBJECT
    • eBINDPOSE_INVALIDROOT
    • eBINDPOSE_NOTALLANCESTORS_NODES
    • eBINDPOSE_NOTALLDEFORMING_NODES
    • eBINDPOSE_NOTALLANCESTORS_DEFNODES
    • eBINDPOSE_RELATIVEMATRIX
    • eFILE_IO_NOTIFICATION
    • eFILE_IO_NOTIFICATION_MATERIAL
    • eFILE_IO_NOTIFICATION_DXF_NOT_SUPPORT_NURBS
    • eAE_START_ID
Enumerator:
eBINDPOSE_INVALIDOBJECT 
eBINDPOSE_INVALIDROOT 
eBINDPOSE_NOTALLANCESTORS_NODES 
eBINDPOSE_NOTALLDEFORMING_NODES 
eBINDPOSE_NOTALLANCESTORS_DEFNODES 
eBINDPOSE_RELATIVEMATRIX 
eFILE_IO_NOTIFICATION 
eFILE_IO_NOTIFICATION_MATERIAL 
eFILE_IO_NOTIFICATION_DXF_NOT_SUPPORT_NURBS 
eAE_START_ID 

Definition at line 192 of file kfbxusernotification.h.

  • eACCUMULATOR_ENTRY
    • eSEQUENCED_DETAILS
Enumerator:
eACCUMULATOR_ENTRY 
eSEQUENCED_DETAILS 

Definition at line 291 of file kfbxusernotification.h.


Constructor & Destructor Documentation

KFbxUserNotification ( KFbxSdkManager pManager,
KString const &  pLogFileName,
KString const &  pSessionDescription  
)

Instantiate a KFbxUserNotification but leave it uninitialized.

The caller must explicitly call InitAccumulator to initialize it and ClearAccumulator when finished using it.

Parameters:
pManager 
pLogFileName  Name of the log file that will be open in the directory defined by the GetLogFilePath method.
Remarks:
If pLogFileName is an empty string the log file does not get created and any output sent to it is lost.
Parameters:
pSessionDescription  This string is used to separate session logs in the file.
Remarks:
If the specified log file already exists, messages are appended to it. This class never deletes the log file. Derived classes may delete the log file before opening (it must be done in the constructor because the log file is opened in the InitAccumulator) or at the end of the processing in the PostTerminate method.

virtual ~KFbxUserNotification (  )  [virtual]

Destructor.


Member Function Documentation

static KFbxUserNotification* Create ( KFbxSdkManager pManager,
const KString pLogFileName,
const KString pSessionDescription  
) [static]

static void Destroy ( KFbxSdkManager pManager  )  [static]

void InitAccumulator (  ) 

This method must be called before using the Accumulator.

It opens the log file and calls AccumulatorInit followed by OpenExtraDevices. Failing to call this method will prevent other actions except ClearAccumulator, GetLogFileName and GetLogFilePath.

void ClearAccumulator (  ) 

This method must be called when the Accumulator is no longer needed.

It calls CloseExtraDevices, followed by the AccumulatorClear, and then closes the log file.

int AddEntry ( const int  pID,
const KString pName,
const KString pDescr,
AccumulatorEntry::AEClass  pClass = AccumulatorEntry::eAE_WARNING  
)

Adds one entry into the accumulator.

Parameters:
pID  This entry unique ID.
pName  This entry name.
pDescr  The description of this entry.
pClass  The category of this entry.
Returns:
The ID of the newly allocated entry. This ID is pEntryId.

int AddDetail ( int  pEntryId  ) 

Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events.

Each call to this method is internally recorded, making it possible to output each notification in the order they have been defined. Also, when a detail is added to an entry, it is automatically unmuted so it can be sent to the devices (muted AccumulatorEntry objects are not processed).

Parameters:
pEntryId  The entry index (as returned by AddEntry).
Returns:
The id of the detail in the recorded sequence of events. This Id should be used when the call to Output has the eSEQUENCED_DETAILS set as a source. If an error occurs, the returned value is -1

int AddDetail ( int  pEntryId,
KString  pString  
)

Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events.

Each call to this method is internally recorded, making it possible to output each notification in the order they have been defined. Also, when a detail is added to an entry, it is automatically unmuted so it can be sent to the devices (muted AccumulatorEntry objects are not processed).

Parameters:
pEntryId  The entry index (as returned by AddEntry).
pString  The detail string to add to the entry.
Returns:
The id of the detail in the recorded sequence of events. This Id should be used when the call to Output has the eSEQUENCED_DETAILS set as a source. If an error occurs, the returned value is -1

int AddDetail ( int  pEntryId,
KFbxNode pNode  
)

Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events.

Each call to this method is internally recorded, making it possible to output each notification in the order they have been defined. Also, when a detail is added to an entry, it is automatically unmuted so it can be sent to the devices (muted AccumulatorEntry objects are not processed).

Parameters:
pEntryId  The entry index (as returned by AddEntry).
pNode  The node to add to the entry.
Returns:
The id of the detail in the recorded sequence of events. This Id should be used when the call to Output has the eSEQUENCED_DETAILS set as a source. If an error occurs, the returned value is -1

int GetNbEntries (  )  const

Returns the number of AccumulatorEntries currently stored in this accumulator.

const AccumulatorEntry* GetEntry ( int  pEntryId  )  const

Get the specified AccumulatorEntry.

Parameters:
pEntryId  ID of the entry to retrieve.
Returns:
Pointer to the specified entry, otherwise NULL if either the id is invalid or the Accumulator is not properly initialized.

const AccumulatorEntry* GetEntryAt ( int  pEntryIndex  )  const

Get the AccumulatorEntry at the specified index.

Parameters:
pEntryIndex  index of the entry to retrieve.
Returns:
Pointer to the specified entry, otherwise NULL if either the index is invalid or the Accumulator is not properly initialized..

int GetNbDetails (  )  const

Returns the number of Details recorded so far in this accumulator.

int GetDetail ( int  pDetailId,
const AccumulatorEntry *&  pAE  
) const

Get the specified detail.

Parameters:
pDetailId  Index of the detail. This is the id-th detail of type pClass as inserted when the AddDetail
pAE  Pointer to the AccumulatorEntry object that contains the requested detail. The returned valued can be NULL if an error occurred.
Returns:
The index of the detail to be used when calling the GetDetail of the AccumulatorEntry.
Remarks:
A value of -1 is acceptable and means that the AccumulatorEntry has no details. However, if pAE is NULL, the return value is meaningless.

bool Output ( OutputSource  pOutSrc = eACCUMULATOR_ENTRY,
int  pIndex = -1,
bool  pExtraDevicesOnly = false  
)

Send the accumulator entries to the output devices.

This method needs to be explicitly called by the program that uses this class.

Parameters:
pOutSrc  Specify which data has to be sent to the output devices. Set to SEQUENCED_DETAILS to send the Details in the recorded order. Set to ACCUMULATOR_ENTRY to send each entry with its details regardless of the order in which the events occurred.
pIndex  If this parameter >= 0, only send the specified entry/detail index to the output devices. Otherwise send all of them.
pExtraDevicesOnly  If this parameter is True, the output is not sent to the log file.
Remarks:
The pExtraDevicesOnly parameter is ignored if the log file has been disabled.

bool OutputById ( AEid  pId,
OutputSource  pOutSrc = eACCUMULATOR_ENTRY,
bool  pExtraDevicesOnly = false  
)

Send the accumulator entry to the output devices.

Parameters:
pId  Send the entry/detail that matching pIdx to the output devices, otherwise send all of them.
pOutSrc  Specify which data has to be sent to the output devices. Set to SEQUENCED_DETAILS to send the Details in the recorded order. Set to ACCUMULATOR_ENTRY to send each entry with its details regardless of the order in which the events occurred..
pExtraDevicesOnly  If this parameter is True, the output is not sent to the log file.

bool Output ( const KString pName,
const KString pDescr,
AccumulatorEntry::AEClass  pClass,
bool  pExtraDevicesOnly = false  
)

Send an immediate entry to the output devices.

This method bypasses the accumulator by sending the entry directly to the output devices and discarding it right after. The internal accumulator lists are left unchanged by this call.

Parameters:
pName  This entry name.
pDescr  The description of this entry.
pClass  The category of this entry.
pExtraDevicesOnly  If this parameter is True, the output is not sent to the log file.
Remarks:
The pExtraDevicesOnly parameter is ignored if the log file has been disabled.

bool Output ( KFbxUserNotificationFilteredIterator pAEFIter,
bool  pExtraDevicesOnly = false  
)

Sends the content of the iterator to the output devices.

This method bypasses the accumulator by sending each entry in the iterator directly to the output devices. The internal accumulator lists are left unchanged by this call.

Parameters:
pAEFIter  The Filtered AccumulatorEntry iterator object.
pExtraDevicesOnly  If this parameter is True, the output is not sent to the log file.
Remarks:
The pExtraDevicesOnly parameter is ignored if the log file has been disabled.

void SetLogMessageEmitter ( KFbxMessageEmitter *  pLogMessageEmitter  ) 

Set log message emitter.

Parameters:
pLogMessageEmitter  The new log message emitter.

virtual void GetLogFilePath ( KString pPath  )  [virtual]

Returns the absolute path to the log file.

If this method is not overridden in a derived class, it returns the TEMP directory.

Parameters:
pPath  The returned path.

KString GetLogFileName (  )  [inline]

Returns the log file name.

Definition at line 356 of file kfbxusernotification.h.

virtual bool PostTerminate (  )  [protected, virtual]

Allow a derived class to finalize processing AFTER the log file handle has been deleted.

This may be required if the log file needs to be moved or shown.

Returns:
True if the object is properly cleaned.

virtual void AccumulatorInit (  )  [protected, virtual]

Allow the implementation class to perform accumulator initializations before the Extra devices are opened.

By default this method does nothing.

virtual void AccumulatorClear (  )  [protected, virtual]

Allow the implementation class to perform accumulator clear after the Extra devices are closed.

By default this method does nothing.

virtual void OpenExtraDevices (  )  [protected, virtual]

Allow the implementation class to opens its output devices (called by InitAccumulator).

By default this method does nothing.

virtual bool SendToExtraDevices ( bool  pOutputNow,
KArrayTemplate< AccumulatorEntry * > &  pEntries  
) [protected, virtual]

Allow the implementation class to send all the accumulator entries to the devices.

By default this method loop trough all the elements of the received array and call the SendToExtraDevices method with the appropriate AccumulatorEntry element and id.

Parameters:
pOutputNow  Flag indicates whether to output now.
pEntries  Accumulator entries to output.
Returns:
true if successful, false otherwise.

virtual bool SendToExtraDevices ( bool  pOutputNow,
KArrayTemplate< AESequence * > &  pAESequence  
) [protected, virtual]

Allow the implementation class to send all the accumulator entries to the devices.

By default this method loop trough all the elements of the received array and call the SendToExtraDevices method with the appropriate AccumulatorEntry element and id.

Parameters:
pOutputNow  Flag indicates whether to output now.
pAESequence  Accumulator entries to output.
Returns:
true if successful, false otherwise.

virtual bool SendToExtraDevices ( bool  pOutputNow,
const AccumulatorEntry pAccEntry,
int  pDetailId = -1  
) [protected, virtual]

Allow the implementation class to send one accumulator entry to the devices.

By default this method does nothing.

Parameters:
pOutputNow  Flag indicates whether to output now.
pAccEntry  Accumulator entry to output.
pDetailId  Detail id.
Returns:
true if successful, false otherwise.
Remarks:
Derived methods should check for the IsMuted() state to decide if the accumulator entry should get through or get discarded. See AddDetail for more details.

virtual void CloseExtraDevices (  )  [protected, virtual]

Allow the implementation class to close it's output devices (called in the ClearAccumulator) By default this method does nothing.

void ResetAccumulator (  )  [protected]

Clears the Accumulator list.

void ResetSequence (  )  [protected]

Clears the Sequence list.

void SendToLog ( OutputSource  pOutSrc,
int  pId  
) [protected]

Send the pIdth element of the accumulator or sequence list to the log file.

Parameters:
pOutSrc  The output source, accumulator or sequence list.
pId  Element id.

void SendToLog ( const AccumulatorEntry pAccEntry,
int  pDetailId = -1  
) [protected]

Send the accumulator entry to the log file.

Parameters:
pAccEntry  The accumulator entry.
pDetailId  Detail id.

Friends And Related Function Documentation

friend class KFbxUserNotificationFilteredIterator [friend]

Definition at line 377 of file kfbxusernotification.h.

KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification
KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification KFbxUserNotification