API Documentation
Loading...
Searching...
No Matches
ProgressInfo.hpp
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: ProgressInfo
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/BaseValues.h>
35
36namespace NDEVR
37{
38 class String;
39 class LogStream;
40 class LogMessage;
41 class TranslatedString;
42
43 /**--------------------------------------------------------------------------------------------------
44 \brief A light-weight base class for Log that allows processes to update, without the need for
45 additional include overheads.
46 **/
48 {
49 public:
50 ProgressInfo() noexcept {};
51 virtual ~ProgressInfo(){};
52 virtual bool setProgress(fltp04 percent) = 0;
53 virtual void allowCancel(bool cancel) = 0;
54 virtual bool addMessage(const LogMessage& message) = 0;
55 virtual bool addMessage(const String& message, uint01 log_level = 10) = 0;
56 virtual bool addMessage(const char* const message, uint01 log_level = 10) = 0;
57 virtual bool addMessage(const TranslatedString& message, uint01 log_level = 10) = 0;
58 virtual void addStream(LogStream*, bool) {}
59 virtual void removeStream(LogStream*) {}
60 virtual void setCancelRequest(bool) {}
61 virtual bool cancelRequested() const { return false; }
62 };
63};
#define NDEVR_BASE_API
Definition DLLInfo.h:57
A class that allows for specific log information to be conveyed to a ProgressInfo object including in...
Definition LogMessage.h:44
A class that listens to a log object and processes the updates in a specified way....
Definition LogStream.h:46
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
virtual ~ProgressInfo()
Definition ProgressInfo.hpp:51
virtual bool addMessage(const String &message, uint01 log_level=10)=0
virtual void setCancelRequest(bool)
Definition ProgressInfo.hpp:60
virtual bool setProgress(fltp04 percent)=0
virtual bool addMessage(const TranslatedString &message, uint01 log_level=10)=0
virtual bool addMessage(const char *const message, uint01 log_level=10)=0
virtual bool addMessage(const LogMessage &message)=0
virtual void addStream(LogStream *, bool)
Definition ProgressInfo.hpp:58
ProgressInfo() noexcept
Definition ProgressInfo.hpp:50
virtual bool cancelRequested() const
Definition ProgressInfo.hpp:61
virtual void removeStream(LogStream *)
Definition ProgressInfo.hpp:59
virtual void allowCancel(bool cancel)=0
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80