Project Documentation Manager BRIGADOON-0002
Project Documentation Manager
Loading...
Searching...
No Matches
DoxygenManager Class Reference

Class for utilising the Doxygen tool. More...

#include <doxygenmanager.h>

Inheritance diagram for DoxygenManager:
[legend]
Collaboration diagram for DoxygenManager:
[legend]

Public Slots

void ReceiveResult (PROJECT_INFORMATION *ProjectInfo)
 Receive the Result of the Worker Function.

Signals

void SendLogEntry (REMOTE_LOG_ENTRY LogEntry)
 Send Log Entry to the Log \LogEntry Structure holding Log information.
void DoxygenDone (void)
 Signal Doxgen has finished a task.
void PrStateChange (PROJECT_INFORMATION *ProjectInfo)
 Signal that State of the Project has changed.
void DoWork (PROJECT_INFORMATION *ProjectInfo)
 Signal the Work task to process this Project.

Public Member Functions

 DoxygenManager ()
 Class Constructor.
 ~DoxygenManager ()
 Class Deconstructor.
void ProcessProject (PROJECT_INFORMATION *ProjectInfo)
 Process documentation for a Project.

Private Slots

void RemoteLogger (REMOTE_LOG_ENTRY LogEntry)

Private Member Functions

void LogAdd (LOGGING_SEVERITY Severity, LOGGING_MODE Mode, QString Message)
 Add a Log Entry.
bool LockProject (int ProjectIndex)
 Lock the Project to prevent alterations.
void DoProject (void)
 Take the next Project in the Queue and process.

Private Attributes

QThread doxy_thread
QList< PROJECT_INFORMATION * > project_list
 Queue of Projects to be processed.
Worker worker
bool project_working = false
 Flag showing is a project is being processed.

Detailed Description

Class for utilising the Doxygen tool.

Definition at line 23 of file doxygenmanager.h.

Constructor & Destructor Documentation

◆ DoxygenManager()

DoxygenManager::DoxygenManager ( )

Class Constructor.

Definition at line 9 of file doxygenmanager.cpp.

10{
11 worker.moveToThread(&doxy_thread);
12 QObject::connect(&doxy_thread, &QThread::finished, &worker, &QObject::deleteLater);
13 QObject::connect(this, SIGNAL(DoWork(PROJECT_INFORMATION*)), &worker, SLOT(DoWork(PROJECT_INFORMATION*)));
14 QObject::connect(&worker, &Worker::WorkDone, this, &DoxygenManager::ReceiveResult);
15 QObject::connect(&worker, &Worker::SendLogEntry, this, &DoxygenManager::RemoteLogger);
16 doxy_thread.start();
17}
void ReceiveResult(PROJECT_INFORMATION *ProjectInfo)
Receive the Result of the Worker Function.
void RemoteLogger(REMOTE_LOG_ENTRY LogEntry)
void DoWork(PROJECT_INFORMATION *ProjectInfo)
Signal the Work task to process this Project.
void SendLogEntry(REMOTE_LOG_ENTRY LogEntry)
void WorkDone(PROJECT_INFORMATION *ProjectInfo)

References DoWork(), doxy_thread, ReceiveResult(), RemoteLogger(), Worker::SendLogEntry(), Worker::WorkDone(), and worker.

Here is the call graph for this function:

◆ ~DoxygenManager()

DoxygenManager::~DoxygenManager ( )

Class Deconstructor.

Definition at line 19 of file doxygenmanager.cpp.

20{
21 doxy_thread.quit();
22 doxy_thread.wait();
23}

References doxy_thread.

Member Function Documentation

◆ DoProject()

void DoxygenManager::DoProject ( void )
private

Take the next Project in the Queue and process.

Definition at line 80 of file doxygenmanager.cpp.

81{
82 if (!project_working)
83 {
84 if (!project_list.empty())
85 {
86 PROJECT_INFORMATION* project_info = project_list.takeFirst();
87 if (LockProject(project_info->ProjectDesc.ProjectIndex))
88 {
89 project_working = true;
90 project_info->ProjectLock = true;
91 project_info->ProjectQueued = false;
92 read_project_info->SetProjectStatus(project_info->ProjectDesc.ProjectIndex, project_info->ProjectLock, project_info->ProjectQueued);
93
94 emit PrStateChange(project_info);
95 emit DoWork(project_info);
96 LogAdd(LOG_DEBUG, MODE_GENERAL, QString("Project %1 sent to Doxygen program.").arg(project_info->ProjectDesc.ProjectIdent));
97 }
98 else
99 {
100 project_info->ProjectLock = false;
101 LogAdd(LOG_INFO, MODE_GENERAL, QString("Project %1 update cancelled as Project already locked.").arg(project_info->ProjectDesc.ProjectIdent));
102 }
103
104 }
105 else
106 {
107 LogAdd(LOG_DEBUG, MODE_GENERAL, "No new projects to be processed.");
108 }
109 }
110 else
111 {
112 LogAdd(LOG_DEBUG, MODE_GENERAL, "Project processing under way - New Project Start deferred.");
113 }
114}
bool project_working
Flag showing is a project is being processed.
void PrStateChange(PROJECT_INFORMATION *ProjectInfo)
Signal that State of the Project has changed.
bool LockProject(int ProjectIndex)
Lock the Project to prevent alterations.
QList< PROJECT_INFORMATION * > project_list
Queue of Projects to be processed.
void LogAdd(LOGGING_SEVERITY Severity, LOGGING_MODE Mode, QString Message)
Add a Log Entry.
bool SetProjectStatus(int ProjectIndex, bool LockState, bool QueueState)
Set the Locked and Queued State of the Project.
ReadProjectInfo * read_project_info
@ LOG_INFO
Definition logger.h:55
@ LOG_DEBUG
Definition logger.h:56
@ MODE_GENERAL
Definition logger.h:24
PROJECT_DESCRIPTION ProjectDesc

References DoWork(), LockProject(), LOG_DEBUG, LOG_INFO, LogAdd(), MODE_GENERAL, project_list, project_working, PROJECT_INFORMATION::ProjectDesc, PROJECT_DESCRIPTION::ProjectIdent, PROJECT_DESCRIPTION::ProjectIndex, PROJECT_INFORMATION::ProjectLock, PROJECT_INFORMATION::ProjectQueued, PrStateChange(), and read_project_info.

Referenced by ProcessProject(), and ReceiveResult().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoWork

void DoxygenManager::DoWork ( PROJECT_INFORMATION * ProjectInfo)
signal

Signal the Work task to process this Project.

Parameters
ProjectInfoStructure holding the Project's Information

Referenced by DoProject(), and DoxygenManager().

Here is the caller graph for this function:

◆ DoxygenDone

void DoxygenManager::DoxygenDone ( void )
signal

Signal Doxgen has finished a task.

◆ LockProject()

bool DoxygenManager::LockProject ( int ProjectIndex)
private

Lock the Project to prevent alterations.

Parameters
TheProject's Index
Returns
Returns Success or Failure in Locking the Project

Definition at line 116 of file doxygenmanager.cpp.

117{
118 return( read_project_info->SetProjectStatus(ProjectIndex, true, false) );
119}

References read_project_info.

Referenced by DoProject().

Here is the caller graph for this function:

◆ LogAdd()

void DoxygenManager::LogAdd ( LOGGING_SEVERITY Severity,
LOGGING_MODE Mode,
QString Message )
private

Add a Log Entry.

Parameters
SeveritySeverity of the Logged Event
ModePart of the Program being Logged
MessageDescription of the Log Event

Definition at line 36 of file doxygenmanager.cpp.

37{
38 REMOTE_LOG_ENTRY log_entry;
39 log_entry.Severity = Severity;
40 log_entry.Mode = Mode;
41 log_entry.Message = Message;
42 emit SendLogEntry(log_entry);
43}
void SendLogEntry(REMOTE_LOG_ENTRY LogEntry)
Send Log Entry to the Log \LogEntry Structure holding Log information.
LOGGING_MODE Mode
Definition logger.h:61
QString Message
Definition logger.h:63
LOGGING_SEVERITY Severity
Definition logger.h:62

References REMOTE_LOG_ENTRY::Message, REMOTE_LOG_ENTRY::Mode, SendLogEntry(), and REMOTE_LOG_ENTRY::Severity.

Referenced by DoProject(), ProcessProject(), and ReceiveResult().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessProject()

void DoxygenManager::ProcessProject ( PROJECT_INFORMATION * ProjectInfo)

Process documentation for a Project.

Parameters
ProjectInfoInformation about the Project

Definition at line 25 of file doxygenmanager.cpp.

26{
27 ProjectInfo->ProjectLock = true;
28 ProjectInfo->ProjectQueued = true;
31 LogAdd( LOG_INFO, MODE_FILE, QString("Project %1 Queued for documentation generation.").arg(ProjectInfo->ProjectDesc.ProjectIdent));
32 project_list.append(ProjectInfo);
33 DoProject();
34}
void DoProject(void)
Take the next Project in the Queue and process.
void PrStateChange(PROJECT_INFORMATION *Project)
Update the Lock/Queued Status of Project in the Project List Table.
ProjectListManager * project_list_manager
@ MODE_FILE
Definition logger.h:32

References DoProject(), LOG_INFO, LogAdd(), MODE_FILE, project_list, project_list_manager, PROJECT_INFORMATION::ProjectDesc, PROJECT_DESCRIPTION::ProjectIdent, PROJECT_DESCRIPTION::ProjectIndex, PROJECT_INFORMATION::ProjectLock, PROJECT_INFORMATION::ProjectQueued, and read_project_info.

Here is the call graph for this function:

◆ PrStateChange

void DoxygenManager::PrStateChange ( PROJECT_INFORMATION * project_info)
signal

Signal that State of the Project has changed.

Parameters
ProjectInfoStructure holding the Project's Information

Referenced by DoProject().

Here is the caller graph for this function:

◆ ReceiveResult

void DoxygenManager::ReceiveResult ( PROJECT_INFORMATION * ProjectInfo)
slot

Receive the Result of the Worker Function.

Definition at line 45 of file doxygenmanager.cpp.

46{
47 // Copy the Appropriate .htaccess form into the website if Document Control iS active and Only Group Access if active
48 if (!(ProjectInfo->InAssocInfo.HtaccessFileName =="") && (ProjectInfo->ProjectDesc.ProjectOptions & CONTROL_DOC_ACCESS) && (ProjectInfo->ProjectDesc.ProjectOptions & GROUP_ACCESS_ONLY))
49 {
50 QString htaccess_file = ProjectInfo->ProgramInformation.SharedTemplateDirectory + "/access_template/" + ProjectInfo->InAssocInfo.HtaccessFileName;
51 QString destin_file = ProjectInfo->ProgramInformation.PrimaryWebsiteDirectory + "/projects/" + ProjectInfo->ProjectDesc.ProjectIdent + "/html/.htaccess";
52 QFile ht_file(htaccess_file);
53 if (ht_file.copy(destin_file))
54 {
55 LogAdd( LOG_DEBUG, MODE_FILE, QString(".htaccess File %1 copied to %2.").arg(htaccess_file, ProjectInfo->ProjectDesc.ProjectIdent));
56 }
57 else
58 {
59 LogAdd( LOG_ERROR, MODE_FILE, QString(".htaccess File %1 FAILED TO COPY to %2.").arg(htaccess_file, ProjectInfo->ProjectDesc.ProjectIdent));
60 }
61 }
62
63 // Release Lock and release Structure
64 ProjectInfo->ProjectLock = false;
65 ProjectInfo->ProjectQueued = false;
67 //emit PrStateChange(ProjectInfo);
68
69
70 project_working = false;
71 delete ProjectInfo;
72 DoProject();
73}
#define CONTROL_DOC_ACCESS
Control Document Access to Public Mask.
#define GROUP_ACCESS_ONLY
restrict Public Access Mask
@ LOG_ERROR
Definition logger.h:52
PROGRAM_INFORMATION ProgramInformation
ASSOCIATED_GROUP_INFO InAssocInfo

References CONTROL_DOC_ACCESS, DoProject(), GROUP_ACCESS_ONLY, ASSOCIATED_GROUP_INFO::HtaccessFileName, PROJECT_INFORMATION::InAssocInfo, LOG_DEBUG, LOG_ERROR, LogAdd(), MODE_FILE, PROGRAM_INFORMATION::PrimaryWebsiteDirectory, PROJECT_INFORMATION::ProgramInformation, project_working, PROJECT_INFORMATION::ProjectDesc, PROJECT_DESCRIPTION::ProjectIdent, PROJECT_DESCRIPTION::ProjectIndex, PROJECT_INFORMATION::ProjectLock, PROJECT_DESCRIPTION::ProjectOptions, PROJECT_INFORMATION::ProjectQueued, read_project_info, and PROGRAM_INFORMATION::SharedTemplateDirectory.

Referenced by DoxygenManager().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoteLogger

void DoxygenManager::RemoteLogger ( REMOTE_LOG_ENTRY LogEntry)
privateslot

Definition at line 75 of file doxygenmanager.cpp.

76{
77 emit SendLogEntry(LogEntry);
78}

References SendLogEntry().

Referenced by DoxygenManager().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendLogEntry

void DoxygenManager::SendLogEntry ( REMOTE_LOG_ENTRY LogEntry)
signal

Send Log Entry to the Log \LogEntry Structure holding Log information.

Referenced by LogAdd(), and RemoteLogger().

Here is the caller graph for this function:

Field Documentation

◆ doxy_thread

QThread DoxygenManager::doxy_thread
private

Definition at line 31 of file doxygenmanager.h.

Referenced by DoxygenManager(), and ~DoxygenManager().

◆ project_list

QList<PROJECT_INFORMATION*> DoxygenManager::project_list
private

Queue of Projects to be processed.

Definition at line 76 of file doxygenmanager.h.

Referenced by DoProject(), and ProcessProject().

◆ project_working

bool DoxygenManager::project_working = false
private

Flag showing is a project is being processed.

Definition at line 101 of file doxygenmanager.h.

Referenced by DoProject(), and ReceiveResult().

◆ worker

Worker DoxygenManager::worker
private

Definition at line 95 of file doxygenmanager.h.

Referenced by DoxygenManager().


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