DATAKIT SDK  V2026.2
dtk_log.hpp
Go to the documentation of this file.
1 #ifndef _DTK_LOG_HPP_
2 #define _DTK_LOG_HPP_
3 #include "def/define.h"
7 #include "util/error_dtk.hpp"
8 #include "util/util_stl_dtk.hpp"
9 
10 class Dtk_Log;
12 
14 {
15 protected:
16  struct Dtk_Handle; // Not defined here
17  Dtk_Handle *_Private; // Handle
18  friend class Dtk_SmartPtr<Dtk_Log>;
19 
20 public:
22  Dtk_Log_Inventory(const Dtk_Log_Inventory& inInventory);
25 
26  //! \brief Get total count of entities in inventory
27  //! \return Total count of entities
29 
30  //! \brief Get number of entity types in inventory
31  //! \return Number of entity types
33 
34  //! \brief Get entity type in inventory from index
35  //! \param [in] inIndex : Index (with range [0..GetNbEntityTypes()-1])
36  //! \return Entity type
38 
39  //! \brief Get count of entities with the same type in inventory from index
40  //! \param [in] inIndex : Index (with range [0..GetNbEntityTypes()-1])
41  //! \return Count of entities
43 
44  //! \brief Adds entity type and its count to inventory
45  //! \param [in] inCount : Count of entities
46  //! \param [in] inName : Entity type
47  // must only be called to fill inventory
48  void AddEntity(int inCount, const Dtk_string& inName);
49 };
50 
52 {
53 protected:
54  struct Dtk_Handle; // Not defined here
55  Dtk_Handle *_Private; // Handle
56 
57 public:
59  Dtk_Log_Message(const Dtk_Log_Message& inMessage);
62 
63  //! \brief Get message type
64  //! \return Message type
65  const Dtk_string & GetType() const;
66 
67  //! \brief Get message
68  //! \return Message
69  const Dtk_string & GetMessageInfo() const;
70 
71  //! \brief Set message type
72  //! \param [in] inValue : Message type
73  void SetType(const Dtk_string& inValue);
74 
75  //! \brief Set message
76  //! \param [in] inValue : Message
77  void SetMessageInfo(const Dtk_string& inValue);
78 };
79 
81 {
82 protected:
83  struct Dtk_Handle; // Not defined here
84  Dtk_Handle *_Private; // Handle
85 
86 public:
91 
92  //! \brief Get if component is a catalog or a not
93  //! \return DTK_TRUE if it is a catalog, DTK_FALSE if otherwise
95 
96  //! \brief Get if component is an assembly or a part
97  //! \return DTK_TRUE if it is an assembly, DTK_FALSE if it is a part
99 
100  //! \brief Get if component is internal
101  //! \return DTK_TRUE if it is internal, DTK_FALSE otherwise
103 
104  //! \brief Get name of component
105  //! \return Name of component
106  const Dtk_string & GetName() const;
107 
108  //! \brief Get full path name of component
109  //! \return Full path name of component
110  const Dtk_string & GetFullPathName() const;
111 
112  //! \brief Get number of instantiations of component
113  //! \return Number of instantiations of component
114  int GetQuantity() const;
115 
116  //! \brief Get file size of component
117  //! \return File size of component
118  long GetFileSize() const;
119 
120  //! \brief Get unit scale of component
121  //! \return Dtk_Double64 in millimeters
123 
124  //! \brief Get file version of component
125  //! \return File version of component
126  const Dtk_string & GetFileVersion() const;
127 
128  //! \brief Get path of component
129  //! \return Path of component
130  const Dtk_string & GetPath();
131 
132  //! \brief Set if component is a catalog
133  //! \param [in] inVal : DTK_TRUE if it is a catalog, DTK_FALSE otherwise
135 
136  //! \brief Set if component is an assembly or a part.
137  //! \param [in] inVal : DTK_TRUE if it is an assembly, DTK_FALSE if it is a part
139 
140  //! \brief Set if component is internal
141  //! \param [in] inVal : DTK_TRUE if it is internal, DTK_FALSE otherswise
143 
144  //! \brief Set name of component
145  //! \param [in] inVal : Name of component
146  void SetName(const Dtk_string& val);
147 
148  //! \brief Set full path name of component
149  //! \param [in] inVal : Full path name of component
150  void SetFullPathName(const Dtk_string& val);
151 
152  //! \brief Set number of instantiations of component
153  //! \param [in] inVal : Number of instantiations of component
154  void SetQuantity(int val);
155 
156  //! \brief Set file size of component
157  //! \param [in] inVal : File size of component
158  void SetFileSize(long val);
159 
160  //! \brief Set unit scale of component
161  //! \param [in] inVal : Dtk_Double64 in millimeters
163 
164  //! \brief Set file version of component
165  //! \param [in] inVal : File version of component
166  void SetFileVersion(const Dtk_string& val);
167 };
168 
169 class Dtk_Log : public Dtk_Object
170 {
171 protected:
172  struct Dtk_Handle; // Not defined here
173  Dtk_Handle *_Private; // Handle
174  enum { _typeID = DTK_TYPE_LOG };
175 
176 private :
177  //void _Init();
178  //void _Copy(const Dtk_Log& s);
179  //void _Reset();
180  friend class Dtk_SmartPtr<Dtk_Log>;
181 
182 public:
184  virtual ~Dtk_Log();
185 
186  //! \CreateBase
187  static Dtk_LogPtr Create();
188  //! \brief downcasting
189  int DtkDynamicType(const int& inId);
190  static Dtk_Log * DtkDynamicCast(Dtk_Object * inObject);
191 
192  //! \brief Get log file name (with .xml extension)
193  //! \return Log file name
194  const Dtk_string & GetLogFileName() const;
195 
196  //! \brief Get API version
197  //! \return API version
198  int GetAPIVersion() const;
199 
200  //! \brief Get product mode
201  //! \return "Psk" if it uses Pskernel, "Dtk" if not
202  const Dtk_string & GetProductMode() const;
203 
204  //! \brief Get input format name
205  //! \return Input format name (an empty string is returned if reading is not used)
206  const Dtk_string & GetInputFormat() const;
207 
208  //! \brief Get output format name
209  //! \return Output format name (an empty string is returned if writing is not used)
210  const Dtk_string & GetOutputFormat() const;
211 
212  //! \brief Get healing flag
213  //! \return -1 if not set, 1 if healing is used, 0 if not
214  int GetHealingFlag() const;
215 
216  //! \brief Get config file name
217  //! \return Config file name
218  const Dtk_string & GetConfigFileName() const;
219 
220  //! \brief Get input file name
221  //! \return Input file name (an empty string is returned if reading is not used)
222  const Dtk_string & GetInputFileName() const;
223 
224  //! \brief Get file version of input file
225  //! \return File version of input file
227 
228  //! \brief Get output file name
229  //! \return Output file name (an empty string is returned if writing is not used)
230  const Dtk_string & GetOutputFileName() const;
231 
232  //! \brief Get size of output file
233  //! \return -1 if not set, size of output file otherwise
234  long GetOutputFileSize() const;
235 
236  //! \brief Get unit scale
237  //! \return double in millimeters
238  double GetUnitScale() const;
239 
240  //! \brief Get start time of process
241  //! \return Start time of process
242  time_t GetStartTime() const;
243 
244  //! \brief Get stop time of process
245  //! \return stop time of process
246  time_t GetStopTime() const;
247 
248  //! \brief Get start hour of process
249  //! \return Start hour of process
250  const Dtk_string & GetStartHour() const;
251 
252  //! \brief Get stop hour of process
253  //! \return stop hour of process
254  const Dtk_string & GetStopHour() const;
255 
256  //! \brief Get CPU time of process
257  //! \return CPU time of process
258  double GetCPUTime() const;
259 
260  //! \brief Get wall time of process
261  //! \return Wall time of process
262  double GetWallTime() const;
263 
264  //! \brief Get peak working set size of process
265  //! \return CPU time of process
267 
268  //! \brief Get working set size of process
269  //! \return Wall time of process
271 
272  //! \brief Get Xsl schema name used in the .xml log file
273  //! \return Xsl schema name ("dtk_versionxxx.xsl")
274  const Dtk_string & GetXslSchemaName() const;
275 
276  //! \brief Get Folder that contains .xsl schema file used in .xml log file
277  //! \return Folder name that contains .xsl schema file
278  const Dtk_string & GetXslFolder() const;
279 
280  //! \brief Get full file path of the .xsl schema file used in .xml log file
281  //! \return File path of the .xsl schema file
283 
284  //! \brief Get if there was a crash or not
285  //! \return DTK_TRUE if yes, DTK_FALSE otherwise
287 
288  //! \brief Get number of sections of the configuration
289  //! \return Number of sections of the configuration
291 
292  //! \brief Get configuration section information (section name, parameters and values) from index
293  //! \param [in] inIndex : Index (with range [0..GetNbConfigSections()-1])
294  //! \param [out] outName : Section name
295  //! \param [out] outParameters : Array of parameters
296  //! \param [out] outValues : Array of values
297  //! \return dtkNoError if OK
299 
300  //! \brief Get list of ID of read components
301  //! \param [in] outListID : Array of component ID (it is empty if reading is not used)
303 
304  //! \brief Get component information from component ID
305  //! \param [in] inComponentID : Component ID
306  //! \param [out] outComponentInfo : Dtk_Log_Component_Info that contains component information
307  //! \return dtkNoError if OK
309 
310  //! \brief Get reading error status of component from component ID
311  //! \param [in] inComponentID : Component ID
312  //! \param [out] outReadingErrorStatus : Reading error status (Dtk_ErrorStatus)
313  //! \return dtkNoError if OK
315 
316  //! \brief Get inventory of component from its ID
317  //! \param [in] inComponentID : Component ID
318  //! \param [out] outInventory : Dtk_Log_Inventory that contains component inventory
319  //! \return dtkNoError if OK
321 
322  //! \brief Get synthetic inventory of component from its ID
323  //! \param [in] inComponentID : Component ID
324  //! \param [out] outInventory : Dtk_Log_Inventory that contains component inventory
325  //! \return dtkNoError if OK
327 
328  //! \brief Get warning messages associated to a component from its ID
329  //! \param [in] inComponentID : Component ID
330  //! \param [out] outMessages : Array of Dtk_Log_Message
331  //! \return dtkNoError if OK
333 
334  //! \brief Get error messages associated to a component from its ID
335  //! \param [in] inComponentID : Component ID
336  //! \param [out] outMessages : Array of Dtk_Log_Message
337  //! \return dtkNoError if OK
339 
340  //! \brief Get info messages associated to a component from its ID
341  //! \param [in] inComponentID : Component ID
342  //! \param [out] outMessages : Array of Dtk_Log_Message
343  //! \return dtkNoError if OK
345 
346  //! \brief Get global warning messages
347  //! \param [out] outMessages : Array of Dtk_Log_Message
348  //! \return dtkNoError if OK
350 
351  //! \brief Get global error messages
352  //! \param [out] outMessages : Array of Dtk_Log_Message
353  //! \return dtkNoError if OK
355 
356  //! \brief Get global info messages
357  //! \param [out] outMessages : Array of Dtk_Log_Message
358  //! \return dtkNoError if OK
360 
361  //! \brief Get List of ID of missing components
362  //! \return Array of Dtk_ID
363  // only useful for reading
365 
366  //! \brief Get list of names of written output files
367  //! \return Array of output file names
368  // only useful for writing
370 
371  //! \brief Get inventory of written output file from its name
372  //! \param [in] inFileName : Name of output file
373  //! \param [out] outInventory : Dtk_Log_Inventory that contains output file inventory
374  //! \return dtkNoError if OK
376 
377  //! \brief Get synthetic inventory of written output file from its name
378  //! \param [in] inFileName : Name of output file
379  //! \param [out] outInventory : Dtk_Log_Inventory that contains output file inventory
380  //! \return dtkNoError if OK
382 
383  //! \brief Get number of validation properties of an output file from its name
384  //! \param [in] inOutputFileName : Name of written output file
385  //! \return Number of validation properties
387 
388  //! \brief Get validation property of an output file from its name and index
389  //! \param [in] inOutputFileName : Name of written output file
390  //! \param [in] inIndex : Index (with range [0..GetNbOutputFileValidationProperties()-1])
391  //! \param [out] outEntityID : Entity ID
392  //! \param [out] outEntityType : Entity type
393  //! \param [out] outValPropName : Validation property name
394  //! \param [out] outRead : Read value
395  //! \param [out] outComputed : Computed value
396  //! \param [out] outGap : Gap value
397  //! \param [out] outStatus : Status
398  //! \return dtkNoError if OK
399  Dtk_ErrorStatus GetOutputFileValidationProperty(const Dtk_string& inOutputFileName, Dtk_Size_t inIndex, Dtk_string &outEntityID, Dtk_string &outEntityType,
400  Dtk_string &outValPropName, Dtk_string &outRead, Dtk_string &outComputed, Dtk_string &outGap, Dtk_string &outStatus);
401 
402  //! \brief Get number of validation properties of a component from its ID
403  //! \param [in] inComponentID : Component ID
404  //! \return Number of validation properties
406 
407  //! \brief Get validation property of a component from its ID and index
408  //! \param [in] inComponentID : Component ID
409  //! \param [in] inIndex : Index (with range [0..GetNbValidationProperties()-1])
410  //! \param [out] outEntityID : Entity ID
411  //! \param [out] outEntityType : Entity type
412  //! \param [out] outValPropName : Validation property name
413  //! \param [out] outRead : Read value
414  //! \param [out] outComputed : Computed value
415  //! \param [out] outGap : Gap value
416  //! \param [out] outStatus : Status
417  //! \return dtkNoError if OK
418  Dtk_ErrorStatus GetValidationProperty(Dtk_Size_t inComponentID, Dtk_Size_t inIndex, Dtk_string &outEntityID, Dtk_string &outEntityType,
419  Dtk_string &outValPropName, Dtk_string &outRead, Dtk_string &outComputed, Dtk_string &outGap, Dtk_string &outStatus);
420 
421  //! \brief Set log file name
422  //! \param [in] inVal : Log file name with .xml extension
423  void SetLogFileName(const Dtk_string& inVal);
424 
425  //! \brief Set product mode
426  //! \param [in] inVal : "Psk" if it uses Pskernel, "Dtk" if not
427  void SetProductMode(const Dtk_string& inVal);
428 
429  //! \brief Set input format name
430  //! \param [in] inVal : Input format name
431  void SetInputFormat(const Dtk_string& inVal);
432 
433  //! \brief Set output format name
434  //! \param [in] inVal : Output format name
435  void SetOutputFormat(const Dtk_string& inVal);
436 
437  //! \brief Set healing flag
438  //! \param [in] inVal : 1 if healing is used, 0 if not
439  void SetHealingFlag(int inVal);
440 
441  //! \brief Set config file name
442  //! \param [in] inVal : Config file name with .dtk extension
443  void SetConfigFileName(const Dtk_string& inVal);
444 
445  //! \brief Set input file name
446  //! \param [in] inVal : Input file name
447  void SetInputFileName(const Dtk_string& inVal);
448 
449  //! \brief Set input file version
450  //! \param [in] inVal : Input file version
451  void SetInputFileVersion(const Dtk_string& inVal);
452 
453  //! \brief Set output file name
454  //! \param [in] inVal : Output file name
455  void SetOutputFileName(const Dtk_string& inVal);
456 
457  //! \brief Set unit scale
458  //! \param [in] inVal : double in millimeters
459  void SetUnitScale(double inVal);
460 
461  //! \brief Set start time
462  //! \param [in] inVal : Start time
463  void SetStartTime(time_t inVal);
464 
465  //! \brief Set stop time
466  //! \param [in] inVal : Stop time
467  void SetStopTime(time_t inVal);
468 
469  //! \brief Set start hour
470  //! \param [in] inVal : Start hour
472 
473  //! \brief Set stop hour
474  //! \param [in] inVal : Stop hour
475  void SetStopHour(Dtk_string inVal);
476 
477  //! \brief Set CPU time
478  //! \param [in] inVal : CPU time
479  void SetCPUTime(double inVal);
480 
481  //! \brief Set wall time
482  //! \param [in] inVal : Wall time
483  void SetWallTime(double inVal);
484 
485  //! \brief Set Peak working set size
486  //! \param [in] inVal : CPU time
488 
489  //! \brief Set working set size
490  //! \param [in] inVal : Wall time
492 
493  //! \brief Set Folder that contains .xsl schema file to use in .xml log file
494  //! \param [in] inVal : Folder name that contains .xsl schema file
495  void SetXslFolder(const Dtk_string& inVal);
496 
497  //! \brief Tells if there was a crash or not
498  //! \param [in] inVal : DTK_TRUE if yes, DTK_FALSE otherwise
499  void SetIsCrash(Dtk_bool inVal);
500 
501  //! \brief Tells if .xsl must be embedded in the .xml log file
502  //! \param [in] inVal : DTK_TRUE if .xsl must be embedded in the .xml log file, DTK_FALSE otherwise
504 
505  //! \brief Fill log with config information (must be called after config initialization)
506  //! \return dtkNoError if OK
508 
509  //! \brief Associates temporary file to another file (used for writing when using temporary file to create another one)
510  //! \param [in] inTemporaryFile : Name of temporary file to associate
511  //! \param [out] inFileName : Name of file to be associated to the temporary file
512  //! \return dtkNoError if OK
513  Dtk_ErrorStatus AssociateFileNames(const Dtk_string& inTemporaryFile, const Dtk_string& inFileName);
514 
515  //! \brief Adds to log a reading inventory and associates it to a component from its ID
516  //! \param [in] inComponentID : Component ID
517  //! \param [in] inNum : Number of entity types
518  //! \param [in] inCount : Array of count of entities (size of array must be inNum)
519  //! \param [in] inEntitiesName : Array of entity names (size of array must be inNum)
520  //! \return dtkNoError if OK
521  Dtk_ErrorStatus AddReadingInventory(Dtk_ID inComponentID, int inNum, const int *inCount, const char **inEntitiesName);
522 
523  //! \brief Adds to log a reading inventory and associates it to a component from its ID
524  //! \param [in] inComponentID : Component ID
525  //! \param [in] inName : entity name
526  //! \param [in] inCount : Number to add (default = 1)
527  //! \return dtkNoError if OK
528  Dtk_ErrorStatus AddReadingEntity(Dtk_ID inComponentID, const char * inName, int inCount=1);
529 
530  //! \brief Adds to log a synthetic reading inventory and associates it to a component from its ID
531  //! \param [in] inComponentID : Component ID
532  //! \param [in] inNum : Number of entity types
533  //! \param [in] inCount : Array of count of entities (size of array must be inNum)
534  //! \param [in] inEntitiesName : Array of entity names (size of array must be inNum)
535  //! \return dtkNoError if OK
536  Dtk_ErrorStatus AddSyntheticReadingInventory(Dtk_ID inComponentID, int inNum, int *inCount, char **inEntitiesName);
537 
538  //! \brief Adds to log a writing inventory and associates it to an output file from its name
539  //! \param [in] inOutputFileName : Output file name
540  //! \param [in] inNum : Number of entity types
541  //! \param [in] inCount : Array of count of entities (size of array must be inNum)
542  //! \param [in] inEntitiesName : Array of entity names (size of array must be inNum)
543  //! \return dtkNoError if OK
544  Dtk_ErrorStatus AddWritingInventory(const Dtk_string& inOutputFileName, int inNum, int *inCount, char **inEntitiesName);
545 
546  //! \brief Adds to log a synthetic writing inventory and associates it to an output file from its name
547  //! \param [in] inOutputFileName : Output file name
548  //! \param [in] inNum : Number of entity types
549  //! \param [in] inCount : Array of count of entities (size of array must be inNum)
550  //! \param [in] inEntitiesName : Array of entity names (size of array must be inNum)
551  //! \return dtkNoError if OK
552  Dtk_ErrorStatus AddSyntheticWritingInventory(const Dtk_string& inOutputFileName, int inNum, int *inCount, char **inEntitiesName);
553 
554  //! \brief Adds to log the name of a written output file
555  //! \param [in] inOutputFileName : Name of written output file
556  //! \param [in] isRoot : DTK_TRUE if output file is root, DTK_FALSE otherwise
557  //! \return dtkNoError if OK
559 
560  //! \brief Adds to log a warning message
561  //! \param [in] inMessage : Message
562  //! \param [in] inType : Type
563  //! \param [in] inComponentID : -1 if message is global, component ID otherwise
564  //! \return dtkNoError if OK
565  Dtk_ErrorStatus AddWarningMessage(const Dtk_string& inMessage, const Dtk_string& inType, int inComponentID = -1);
566 
567  //! \brief Adds to log an error message
568  //! \param [in] inMessage : Message
569  //! \param [in] inType : Type
570  //! \param [in] inComponentID : -1 if message is global, component ID otherwise
571  //! \return dtkNoError if OK
572  Dtk_ErrorStatus AddErrorMessage(const Dtk_string& inMessage, const Dtk_string& inType, int inComponentID = -1);
573 
574  //! \brief Adds to log an info message
575  //! \param [in] inMessage : Message
576  //! \param [in] inType : Type
577  //! \param [in] inComponentID : -1 if message is global, component ID otherwise
578  //! \return dtkNoError if OK
579  Dtk_ErrorStatus AddInfoMessage(const Dtk_string& inMessage, const Dtk_string& inType, int inComponentID = -1);
580 
581  //! \brief Adds to log the info of a read component and its reading error status
582  //! \param [in] inComponent : Dtk_ComponentPtr pointer to the read component
583  //! \param [in] inStatus : Reading error status (Dtk_ErrorStatus)
584  //! \return dtkNoError if OK
586 
587  //! \brief Adds to log the info of a read file and its reading error status (must only be called if Dtk_ComponentPtr is not used by reading)
588  //! \param [in] inInputFileName : Input file name
589  //! \param [in] inFileVersion : Input file version
590  //! \param [in] inIsAssembly : 1 if root component of the file is an assembly, 0 if it is a part
591  //! \param [in] inUnitScale : Dtk_Double64 in millimeters
592  //! \param [in] inStatus : Reading error status (Dtk_ErrorStatus)
593  //! \return dtkNoError if OK
594  Dtk_ErrorStatus AddFileInfoAndReadingErrorStatus(const Dtk_string& inInputFileName, Dtk_string inFileVersion, Dtk_bool inIsAssembly,
595  Dtk_Double64 inUnitScale, Dtk_ErrorStatus inStatus);
596 
597  //! \brief Add to log the validation property of a component from its ID
598  //! \param [in] inComponentID : Component ID
599  //! \param [in] inEntityID : Entity ID
600  //! \param [in] inEntityType : Entity type
601  //! \param [in] inValPropName : Validation property name
602  //! \param [in] inRead : Read value
603  //! \param [in] inComputed : Computed value
604  //! \param [in] inGap : Gap value
605  //! \param [in] inStatus : Status
606  //! \return dtkNoError if OK
607  Dtk_ErrorStatus AddValidationProperty(Dtk_Size_t inComponentID, const Dtk_string &inEntityID, const Dtk_string &inEntityType,
608  const Dtk_string &inValPropName, const Dtk_string &inRead, const Dtk_string &inComputed,
609  const Dtk_string &inGap, const Dtk_string &inStatus);
610 
611  //! \brief Add to log the validation property of an output file from its name
612  //! \param [in] inOutputFileName : Name of written output file
613  //! \param [in] inEntityID : Entity ID
614  //! \param [in] inEntityType : Entity type
615  //! \param [in] inValPropName : Validation property name
616  //! \param [in] inWrite : Write value
617  //! \return dtkNoError if OK
618  Dtk_ErrorStatus AddOutputFileValidationProperty(const Dtk_string& inOutputFileName, const Dtk_string &inEntityID, const Dtk_string &inEntityType,
619  const Dtk_string &inValPropName, const Dtk_string &inWrite);
620 
621  //! \brief Write the content of the log into the .xml file (SetLogFileName() must be called for that)
622  //! \return dtkNoError if OK
624 
625  //! \brief Flush the content of the log
626  //! \return dtkNoError if OK
628 };
629 
630 
631 
632 
633 #endif
Dtk_Log_Component_Info::GetName
const Dtk_string & GetName() const
Get name of component.
Dtk_Log::SetInputFileVersion
void SetInputFileVersion(const Dtk_string &inVal)
Set input file version.
Dtk_Log::SetStopHour
void SetStopHour(Dtk_string inVal)
Set stop hour.
Dtk_Log_Message
Definition: dtk_log.hpp:52
Dtk_Log::SetInputFormat
void SetInputFormat(const Dtk_string &inVal)
Set input format name.
Dtk_Log::FillConfig
Dtk_ErrorStatus FillConfig()
Fill log with config information (must be called after config initialization)
Dtk_Log_Message::GetType
const Dtk_string & GetType() const
Get message type
Dtk_ID
uint32_t Dtk_ID
Definition: define.h:681
Dtk_Log::GetOutputFileNamesWritten
const Dtk_tab< Dtk_string > & GetOutputFileNamesWritten() const
Get list of names of written output files.
Dtk_Log::AssociateFileNames
Dtk_ErrorStatus AssociateFileNames(const Dtk_string &inTemporaryFile, const Dtk_string &inFileName)
Associates temporary file to another file (used for writing when using temporary file to create anoth...
Dtk_Log
Definition: dtk_log.hpp:170
Dtk_Log::SetCPUTime
void SetCPUTime(double inVal)
Set CPU time.
Dtk_Log::AddReadingEntity
Dtk_ErrorStatus AddReadingEntity(Dtk_ID inComponentID, const char *inName, int inCount=1)
Adds to log a reading inventory and associates it to a component from its ID
Dtk_Log_Component_Info::operator=
Dtk_Log_Component_Info & operator=(const Dtk_Log_Component_Info &inComponentInfo)
Dtk_Log_Component_Info::SetQuantity
void SetQuantity(int val)
Set number of instantiations of component.
Dtk_Log::GetComponentReadingErrorStatus
Dtk_ErrorStatus GetComponentReadingErrorStatus(Dtk_Size_t inComponentID, Dtk_ErrorStatus &outReadingErrorStatus)
Get reading error status of component from component ID.
Dtk_Log_Component_Info::GetFileVersion
const Dtk_string & GetFileVersion() const
Get file version of component
Dtk_UInt64
uint64_t Dtk_UInt64
Definition: define.h:685
Dtk_Log_Component_Info::Dtk_Log_Component_Info
Dtk_Log_Component_Info()
Dtk_Log_Component_Info::SetFullPathName
void SetFullPathName(const Dtk_string &val)
Set full path name of component.
Dtk_Log::SetWorkingSetSize
void SetWorkingSetSize(Dtk_UInt64 inVal)
Set working set size.
Dtk_Log_Component_Info::Dtk_Log_Component_Info
Dtk_Log_Component_Info(const Dtk_Log_Component_Info &inComponentInfo)
Dtk_Log::GetOutputFileName
const Dtk_string & GetOutputFileName() const
Get output file name.
Dtk_Log::GetXslSchemaName
const Dtk_string & GetXslSchemaName() const
Get Xsl schema name used in the .xml log file.
Dtk_Log::GetOutputFileInventory
Dtk_ErrorStatus GetOutputFileInventory(Dtk_string inFileName, Dtk_Log_Inventory &outInventory)
Get inventory of written output file from its name.
Dtk_Log_Message::operator=
Dtk_Log_Message & operator=(const Dtk_Log_Message &inMessage)
Dtk_Log::AddSyntheticReadingInventory
Dtk_ErrorStatus AddSyntheticReadingInventory(Dtk_ID inComponentID, int inNum, int *inCount, char **inEntitiesName)
Adds to log a synthetic reading inventory and associates it to a component from its ID
Dtk_Log::GetLogFileName
const Dtk_string & GetLogFileName() const
Get log file name (with .xml extension)
Dtk_Log_Inventory::Dtk_Log_Inventory
Dtk_Log_Inventory(const Dtk_Log_Inventory &inInventory)
Dtk_Log_Component_Info::GetFileSize
long GetFileSize() const
Get file size of component.
Dtk_Log_Component_Info::GetQuantity
int GetQuantity() const
Get number of instantiations of component
Dtk_Log_Message::_Private
Dtk_Handle * _Private
Definition: dtk_log.hpp:54
Dtk_Log_Message::~Dtk_Log_Message
~Dtk_Log_Message()
Dtk_Log::SetProductMode
void SetProductMode(const Dtk_string &inVal)
Set product mode.
Dtk_Log::GetStopHour
const Dtk_string & GetStopHour() const
Get stop hour of process
Dtk_Log_Component_Info::SetUnitScale
void SetUnitScale(Dtk_Double64 val)
Set unit scale of component.
Dtk_Log_Component_Info::GetPath
const Dtk_string & GetPath()
Get path of component.
Dtk_Log::Flush
virtual Dtk_ErrorStatus Flush()
Flush the content of the log.
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
Dtk_Log::SetIsXslEmbedded
void SetIsXslEmbedded(Dtk_bool inVal)
Tells if .xsl must be embedded in the .xml log file.
Dtk_Log::GetNbOutputFileValidationProperties
Dtk_Size_t GetNbOutputFileValidationProperties(const Dtk_string &inOutputFileName)
Get number of validation properties of an output file from its name.
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:704
Dtk_Log::GetNbValidationProperties
Dtk_Size_t GetNbValidationProperties(Dtk_Size_t inComponentID)
Get number of validation properties of a component from its ID.
Dtk_Log_Inventory::Dtk_Log_Inventory
Dtk_Log_Inventory()
Dtk_Log::SetUnitScale
void SetUnitScale(double inVal)
Set unit scale.
Dtk_Log::GetStartHour
const Dtk_string & GetStartHour() const
Get start hour of process
Dtk_Log::DtkDynamicCast
static Dtk_Log * DtkDynamicCast(Dtk_Object *inObject)
Dtk_Log::SetIsCrash
void SetIsCrash(Dtk_bool inVal)
Tells if there was a crash or not.
Dtk_Log_Component_Info::GetIsAssembly
Dtk_bool GetIsAssembly() const
Get if component is an assembly or a part
Dtk_Log::AddSyntheticWritingInventory
Dtk_ErrorStatus AddSyntheticWritingInventory(const Dtk_string &inOutputFileName, int inNum, int *inCount, char **inEntitiesName)
Adds to log a synthetic writing inventory and associates it to an output file from its name
Dtk_Log::Create
static Dtk_LogPtr Create()
Calls default constructor to allocate a new object.
Dtk_Log_Component_Info::GetFullPathName
const Dtk_string & GetFullPathName() const
Get full path name of component.
DTK_FALSE
#define DTK_FALSE
Definition: define.h:720
Dtk_bool
char Dtk_bool
Definition: define.h:717
Dtk_Log::GetPeakWorkingSetSize
Dtk_UInt64 GetPeakWorkingSetSize() const
Get peak working set size of process
Dtk_Log::GetHealingFlag
int GetHealingFlag() const
Get healing flag.
Dtk_Double64
double Dtk_Double64
Definition: define.h:691
Dtk_Log_Message::Dtk_Log_Message
Dtk_Log_Message()
Dtk_Log::GetAPIVersion
int GetAPIVersion() const
Get API version.
Dtk_Log_Inventory::GetNbEntityTypes
Dtk_Size_t GetNbEntityTypes()
Get number of entity types in inventory
Dtk_Log_Inventory
Definition: dtk_log.hpp:14
Dtk_Log::~Dtk_Log
virtual ~Dtk_Log()
Dtk_Log::GetComponentInfo
Dtk_ErrorStatus GetComponentInfo(Dtk_Size_t inComponentID, Dtk_Log_Component_Info &outComponentInfo)
Get component information from component ID.
Dtk_Log::GetWorkingSetSize
Dtk_UInt64 GetWorkingSetSize() const
Get working set size of process
Dtk_Log_Component_Info::GetUnitScale
Dtk_Double64 GetUnitScale() const
Get unit scale of component.
Dtk_Log::GetInputFileVersion
const Dtk_string & GetInputFileVersion() const
Get file version of input file
Dtk_Log::GetListComponentID
Dtk_ErrorStatus GetListComponentID(Dtk_tab< Dtk_ID > &outListID)
Get list of ID of read components.
Dtk_Log::SetStartTime
void SetStartTime(time_t inVal)
Set start time.
Dtk_Log_Component_Info::GetIsInternal
Dtk_bool GetIsInternal() const
Get if component is internal
Dtk_Log_Component_Info::SetIsInternal
void SetIsInternal(Dtk_bool val)
Set if component is internal.
Dtk_Log::GetXslFolder
const Dtk_string & GetXslFolder() const
Get Folder that contains .xsl schema file used in .xml log file
Dtk_Log::Write
virtual Dtk_ErrorStatus Write()
Write the content of the log into the .xml file (SetLogFileName() must be called for that)
Dtk_Log::AddErrorMessage
Dtk_ErrorStatus AddErrorMessage(const Dtk_string &inMessage, const Dtk_string &inType, int inComponentID=-1)
Adds to log an error message.
Dtk_Log::GetGlobalWarningMessages
Dtk_ErrorStatus GetGlobalWarningMessages(Dtk_tab< Dtk_Log_Message > &outMessages)
Get global warning messages.
Dtk_Log::AddReadingInventory
Dtk_ErrorStatus AddReadingInventory(Dtk_ID inComponentID, int inNum, const int *inCount, const char **inEntitiesName)
Adds to log a reading inventory and associates it to a component from its ID
Dtk_Log::GetStartTime
time_t GetStartTime() const
Get start time of process
Dtk_Log::GetComponentWarningMessages
Dtk_ErrorStatus GetComponentWarningMessages(Dtk_Size_t inComponentID, Dtk_tab< Dtk_Log_Message > &outMessages)
Get warning messages associated to a component from its ID.
Dtk_Log_Message::SetMessageInfo
void SetMessageInfo(const Dtk_string &inValue)
Set message.
Dtk_Log::AddFileInfoAndReadingErrorStatus
Dtk_ErrorStatus AddFileInfoAndReadingErrorStatus(const Dtk_string &inInputFileName, Dtk_string inFileVersion, Dtk_bool inIsAssembly, Dtk_Double64 inUnitScale, Dtk_ErrorStatus inStatus)
Adds to log the info of a read file and its reading error status (must only be called if Dtk_Componen...
Dtk_Log_Component_Info::SetIsAssembly
void SetIsAssembly(Dtk_bool val)
Set if component is an assembly or a part.
Dtk_Log_Component_Info
Definition: dtk_log.hpp:81
Dtk_Log::GetOutputFileValidationProperty
Dtk_ErrorStatus GetOutputFileValidationProperty(const Dtk_string &inOutputFileName, Dtk_Size_t inIndex, Dtk_string &outEntityID, Dtk_string &outEntityType, Dtk_string &outValPropName, Dtk_string &outRead, Dtk_string &outComputed, Dtk_string &outGap, Dtk_string &outStatus)
Get validation property of an output file from its name and index.
Dtk_Log::GetConfigSection
Dtk_ErrorStatus GetConfigSection(Dtk_Size_t inIndex, Dtk_string &outName, Dtk_tab< Dtk_string > &outParameters, Dtk_tab< Dtk_string > &outValues)
Get configuration section information (section name, parameters and values) from index.
dtk_maindoc_ptr.hpp
Dtk_Log_Component_Info::GetIsCatalog
Dtk_bool GetIsCatalog() const
Get if component is a catalog or a not
Dtk_Log::GetOutputFormat
const Dtk_string & GetOutputFormat() const
Get output format name.
Dtk_Log::GetGlobalErrorMessages
Dtk_ErrorStatus GetGlobalErrorMessages(Dtk_tab< Dtk_Log_Message > &outMessages)
Get global error messages.
Dtk_Log::DtkDynamicType
int DtkDynamicType(const int &inId)
downcasting
error_dtk.hpp
Dtk_Log_Component_Info::_Private
Dtk_Handle * _Private
Definition: dtk_log.hpp:83
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Dtk_Log::GetWallTime
double GetWallTime() const
Get wall time of process
Dtk_Log::GetComponentInfoMessages
Dtk_ErrorStatus GetComponentInfoMessages(Dtk_Size_t inComponentID, Dtk_tab< Dtk_Log_Message > &outMessages)
Get info messages associated to a component from its ID.
Dtk_Log::AddWritingInventory
Dtk_ErrorStatus AddWritingInventory(const Dtk_string &inOutputFileName, int inNum, int *inCount, char **inEntitiesName)
Adds to log a writing inventory and associates it to an output file from its name
Dtk_Log::SetConfigFileName
void SetConfigFileName(const Dtk_string &inVal)
Set config file name.
Dtk_Log_Component_Info::SetFileSize
void SetFileSize(long val)
Set file size of component.
Dtk_Log::SetOutputFileName
void SetOutputFileName(const Dtk_string &inVal)
Set output file name.
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
Dtk_Log_Inventory::_Private
Dtk_Handle * _Private
Definition: dtk_log.hpp:16
Dtk_Log::SetPeakWorkingSetSize
void SetPeakWorkingSetSize(Dtk_UInt64 inVal)
Set Peak working set size.
Dtk_Log::AddOutputFileValidationProperty
Dtk_ErrorStatus AddOutputFileValidationProperty(const Dtk_string &inOutputFileName, const Dtk_string &inEntityID, const Dtk_string &inEntityType, const Dtk_string &inValPropName, const Dtk_string &inWrite)
Add to log the validation property of an output file from its name.
Dtk_Log_Message::Dtk_Log_Message
Dtk_Log_Message(const Dtk_Log_Message &inMessage)
Dtk_Log::GetStopTime
time_t GetStopTime() const
Get stop time of process
Dtk_Log::AddComponentInfoAndReadingErrorStatus
Dtk_ErrorStatus AddComponentInfoAndReadingErrorStatus(const Dtk_ComponentPtr &inComponent, Dtk_ErrorStatus inStatus)
Adds to log the info of a read component and its reading error status.
Dtk_Log::GetComponentSyntheticInventory
Dtk_ErrorStatus GetComponentSyntheticInventory(Dtk_Size_t inComponentID, Dtk_Log_Inventory &outInventory)
Get synthetic inventory of component from its ID.
Dtk_Log_Component_Info::SetFileVersion
void SetFileVersion(const Dtk_string &val)
Set file version of component.
Dtk_Log_Message::SetType
void SetType(const Dtk_string &inValue)
Set message type.
Dtk_Log_Inventory::GetTotalCount
Dtk_Size_t GetTotalCount()
Get total count of entities in inventory
Dtk_Log_Inventory::GetEntityType
const Dtk_string & GetEntityType(Dtk_Size_t inIndex)
Get entity type in inventory from index.
Dtk_Log::GetConfigFileName
const Dtk_string & GetConfigFileName() const
Get config file name.
util_stl_dtk.hpp
Dtk_Log::GetInputFormat
const Dtk_string & GetInputFormat() const
Get input format name.
Dtk_Log::SetHealingFlag
void SetHealingFlag(int inVal)
Set healing flag.
Dtk_Log::GetProductMode
const Dtk_string & GetProductMode() const
Get product mode.
define.h
Dtk_Log::GetUnitScale
double GetUnitScale() const
Get unit scale.
Dtk_Log_Component_Info::SetIsCatalog
void SetIsCatalog(Dtk_bool val)
Set if component is a catalog.
Dtk_Log::Dtk_Log
Dtk_Log()
Dtk_Log_Component_Info::SetName
void SetName(const Dtk_string &val)
Set name of component.
Dtk_tab< Dtk_string >
Dtk_Log::GetOutputFileSyntheticInventory
Dtk_ErrorStatus GetOutputFileSyntheticInventory(Dtk_string inFileName, Dtk_Log_Inventory &outInventory)
Get synthetic inventory of written output file from its name.
Dtk_Log::GetNbConfigSections
Dtk_Size_t GetNbConfigSections()
Get number of sections of the configuration
Dtk_Log::AddOutputFileNameWritten
Dtk_ErrorStatus AddOutputFileNameWritten(const Dtk_string &inOutputFileName, Dtk_bool isRoot=DTK_FALSE)
Adds to log the name of a written output file.
Dtk_Log::SetLogFileName
void SetLogFileName(const Dtk_string &inVal)
Set log file name.
Dtk_Log::SetOutputFormat
void SetOutputFormat(const Dtk_string &inVal)
Set output format name.
Dtk_Log::AddValidationProperty
Dtk_ErrorStatus AddValidationProperty(Dtk_Size_t inComponentID, const Dtk_string &inEntityID, const Dtk_string &inEntityType, const Dtk_string &inValPropName, const Dtk_string &inRead, const Dtk_string &inComputed, const Dtk_string &inGap, const Dtk_string &inStatus)
Add to log the validation property of a component from its ID.
Dtk_Log::AddWarningMessage
Dtk_ErrorStatus AddWarningMessage(const Dtk_string &inMessage, const Dtk_string &inType, int inComponentID=-1)
Adds to log a warning message.
Dtk_Object
Definition: dtk_object.hpp:8
Dtk_Log::_Private
Dtk_Handle * _Private
Definition: dtk_log.hpp:172
Dtk_Log::_typeID
@ _typeID
Definition: dtk_log.hpp:174
Dtk_Log::SetXslFolder
void SetXslFolder(const Dtk_string &inVal)
Set Folder that contains .xsl schema file to use in .xml log file.
dtk_string.hpp
Dtk_Log::GetListMissingComponents
Dtk_tab< Dtk_ID > GetListMissingComponents()
Get List of ID of missing components.
Dtk_Log::GetOutputFileSize
long GetOutputFileSize() const
Get size of output file
Dtk_Log::GetValidationProperty
Dtk_ErrorStatus GetValidationProperty(Dtk_Size_t inComponentID, Dtk_Size_t inIndex, Dtk_string &outEntityID, Dtk_string &outEntityType, Dtk_string &outValPropName, Dtk_string &outRead, Dtk_string &outComputed, Dtk_string &outGap, Dtk_string &outStatus)
Get validation property of a component from its ID and index.
Dtk_Log::GetCPUTime
double GetCPUTime() const
Get CPU time of process
Dtk_Log::SetStopTime
void SetStopTime(time_t inVal)
Set stop time.
DTK_TYPE_LOG
@ DTK_TYPE_LOG
Definition: define.h:587
Dtk_Log_Component_Info::~Dtk_Log_Component_Info
~Dtk_Log_Component_Info()
Dtk_Log::AddInfoMessage
Dtk_ErrorStatus AddInfoMessage(const Dtk_string &inMessage, const Dtk_string &inType, int inComponentID=-1)
Adds to log an info message.
Dtk_Log::GetIsCrash
Dtk_bool GetIsCrash()
Get if there was a crash or not
Dtk_Log::GetComponentErrorMessages
Dtk_ErrorStatus GetComponentErrorMessages(Dtk_Size_t inComponentID, Dtk_tab< Dtk_Log_Message > &outMessages)
Get error messages associated to a component from its ID.
Dtk_Log_Inventory::~Dtk_Log_Inventory
~Dtk_Log_Inventory()
Dtk_LogPtr
Dtk_SmartPtr< Dtk_Log > Dtk_LogPtr
Definition: dtk_log.hpp:10
Dtk_Log::GetGlobalInfoMessages
Dtk_ErrorStatus GetGlobalInfoMessages(Dtk_tab< Dtk_Log_Message > &outMessages)
Get global info messages.
Dtk_Log::GetInputFileName
const Dtk_string & GetInputFileName() const
Get input file name.
Dtk_Log::SetStartHour
void SetStartHour(Dtk_string inVal)
Set start hour.
Dtk_Log_Inventory::operator=
Dtk_Log_Inventory & operator=(const Dtk_Log_Inventory &inInventory)
Dtk_Log::GetXslFilePath
Dtk_string GetXslFilePath() const
Get full file path of the .xsl schema file used in .xml log file
Dtk_Log::GetComponentInventory
Dtk_ErrorStatus GetComponentInventory(Dtk_Size_t inComponentID, Dtk_Log_Inventory &outInventory)
Get inventory of component from its ID.
Dtk_Log_Inventory::AddEntity
void AddEntity(int inCount, const Dtk_string &inName)
Adds entity type and its count to inventory
Dtk_Log_Message::GetMessageInfo
const Dtk_string & GetMessageInfo() const
Get message
dtk_object.hpp
Dtk_Log::SetInputFileName
void SetInputFileName(const Dtk_string &inVal)
Set input file name.
Dtk_Log::SetWallTime
void SetWallTime(double inVal)
Set wall time.
Dtk_Log_Inventory::GetEntitiesCount
int GetEntitiesCount(Dtk_Size_t inIndex)
Get count of entities with the same type in inventory from index.