MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / AddQueueOp

Method AddQueueOp

src/FTPQueue.cpp:91–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91int FTPQueue::AddQueueOp(QueueOperation * op) {
92 op->SetClient(m_wrapper);
93
94 m_monitor->Enter();
95 VQueue::iterator it;
96 for(it = m_queue.begin(); it != m_queue.end(); ++it) {
97 if (op->Equals(**it)) {
98 OutMsg("[Queue] The operation was already added to the queue, ignoring");
99 m_monitor->Exit();
100 return 0;
101 }
102 }
103 m_monitor->Exit();
104
105 //Can safely inform queueWindow, Add is called by window thread
106 op->SendNotification(QueueOperation::QueueEventAdd);
107
108 m_monitor->Enter();
109 m_queue.push_back(op);
110 if (m_queue.size() == 1)
111 m_monitor->Signal(ConditionQueueOps);
112 m_monitor->Exit();
113
114 return 0;
115}
116
117int FTPQueue::GetQueueSize() const {
118 int res = 0;

Callers 13

ConnectMethod · 0.80
GetDirectoryMethod · 0.80
GetDirectoryHierarchyMethod · 0.80
DownloadFileMethod · 0.80
DownloadFileHandleMethod · 0.80
UploadFileMethod · 0.80
CopyFileMethod · 0.80
MkDirMethod · 0.80
RmDirMethod · 0.80
MkFileMethod · 0.80
DeleteFileMethod · 0.80
RenameMethod · 0.80

Calls 7

SetClientMethod · 0.80
EnterMethod · 0.80
EqualsMethod · 0.80
ExitMethod · 0.80
SendNotificationMethod · 0.80
sizeMethod · 0.80
SignalMethod · 0.80

Tested by

no test coverage detected