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.
void ProduceProjectLists (void)

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
15 QObject::connect (&worker, &Worker::WorkDone, this,
17
18 QObject::connect (&worker, &Worker::SendLogEntry, this,
20
21 doxy_thread.start();
22}
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 24 of file doxygenmanager.cpp.

25{
26 doxy_thread.quit();
27 doxy_thread.wait();
28}

References doxy_thread.

Member Function Documentation

◆ DoProject()

void DoxygenManager::DoProject ( void )
private

Take the next Project in the Queue and process.

Definition at line 92 of file doxygenmanager.cpp.

93{
94 if (!project_working)
95 {
96 if (!project_list.empty())
97 {
98 PROJECT_INFORMATION* project_info = project_list.takeFirst();
99 if (LockProject(project_info->ProjectDesc.ProjectIndex))
100 {
101 project_working = true;
102 project_info->ProjectLock = true;
103 project_info->ProjectQueued = false;
104 read_project_info->SetProjectStatus(project_info->ProjectDesc.ProjectIndex, project_info->ProjectLock, project_info->ProjectQueued);
105
106 emit PrStateChange(project_info);
107 emit DoWork(project_info);
108 LogAdd(LOG_DEBUG, MODE_GENERAL, QString("Project %1 sent to Doxygen program.").arg(project_info->ProjectDesc.ProjectIdent));
109 }
110 else
111 {
112 project_info->ProjectLock = false;
113 LogAdd(LOG_INFO, MODE_GENERAL, QString("Project %1 update cancelled as Project already locked.").arg(project_info->ProjectDesc.ProjectIdent));
114 }
115
116 }
117 else
118 {
119 LogAdd(LOG_DEBUG, MODE_GENERAL, "No new projects to be processed.");
120 }
121 }
122 else
123 {
124 LogAdd(LOG_DEBUG, MODE_GENERAL, "Project processing under way - New Project Start deferred.");
125 }
126}
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 128 of file doxygenmanager.cpp.

129{
130 return( read_project_info->SetProjectStatus(ProjectIndex, true, false) );
131}

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 41 of file doxygenmanager.cpp.

42{
43 REMOTE_LOG_ENTRY log_entry;
44 log_entry.Severity = Severity;
45 log_entry.Mode = Mode;
46 log_entry.Message = Message;
47 emit SendLogEntry(log_entry);
48}
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 30 of file doxygenmanager.cpp.

31{
32 ProjectInfo->ProjectLock = true;
33 ProjectInfo->ProjectQueued = true;
35 // project_list_manager->PrStateChange(ProjectInfo);
36 LogAdd( LOG_INFO, MODE_FILE, QString("Project %1 Queued for documentation generation.").arg(ProjectInfo->ProjectDesc.ProjectIdent));
37 project_list.append(ProjectInfo);
38 DoProject();
39}
void DoProject(void)
Take the next Project in the Queue and process.
@ MODE_FILE
Definition logger.h:32

References DoProject(), LOG_INFO, LogAdd(), MODE_FILE, project_list, 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:

◆ ProduceProjectLists

void DoxygenManager::ProduceProjectLists ( void )
signal

Referenced by ReceiveResult().

Here is the caller 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(), and ReceiveResult().

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 50 of file doxygenmanager.cpp.

51{
52 // Create the Extrnal text and HTML Project List Files
53 emit ProduceProjectLists ();
54
55 // Copy the Appropriate .htaccess form into the website if Document Control
56 // iS active and Only Group Access if active
57 if (!(ProjectInfo->InAssocInfo.HtaccessFileName == "")
60 {
61 QString htaccess_file = ProjectInfo->ProgramInformation.SharedTemplateDirectory + "/access_template/" + ProjectInfo->InAssocInfo.HtaccessFileName;
62 QString destin_file = ProjectInfo->ProgramInformation.PrimaryWebsiteDirectory + "/projects/" + ProjectInfo->ProjectDesc.ProjectIdent + "/html/.htaccess";
63 QFile ht_file(htaccess_file);
64 if (ht_file.copy(destin_file))
65 {
66 LogAdd( LOG_DEBUG, MODE_FILE, QString(".htaccess File %1 copied to %2.").arg(htaccess_file, ProjectInfo->ProjectDesc.ProjectIdent));
67 }
68 else
69 {
70 LogAdd( LOG_ERROR, MODE_FILE, QString(".htaccess File %1 FAILED TO COPY to %2.").arg(htaccess_file, ProjectInfo->ProjectDesc.ProjectIdent));
71 }
72 // delete ProjectInfo;
73 }
74
75 // Release Lock and release Structure
76 ProjectInfo->ProjectLock = false;
77 ProjectInfo->ProjectQueued = false;
79 ProjectInfo->ProjectLock,
80 ProjectInfo->ProjectQueued);
81 emit PrStateChange (ProjectInfo);
82
83 project_working = false;
84 DoProject ();
85}
void ProduceProjectLists(void)
#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, ProduceProjectLists(), PROJECT_INFORMATION::ProgramInformation, project_working, PROJECT_INFORMATION::ProjectDesc, PROJECT_DESCRIPTION::ProjectIdent, PROJECT_DESCRIPTION::ProjectIndex, PROJECT_INFORMATION::ProjectLock, PROJECT_DESCRIPTION::ProjectOptions, PROJECT_INFORMATION::ProjectQueued, PrStateChange(), 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 87 of file doxygenmanager.cpp.

88{
89 emit SendLogEntry(LogEntry);
90}

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 75 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 100 of file doxygenmanager.h.

Referenced by DoProject(), and ReceiveResult().

◆ worker

Worker DoxygenManager::worker
private

Definition at line 94 of file doxygenmanager.h.

Referenced by DoxygenManager().


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