libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
ScheduledTask.hpp
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright © 2002 by J.M.McGuiness, coder@hussar.me.uk
3
**
4
** This library is free software; you can redistribute it and/or
5
** modify it under the terms of the GNU Lesser General Public
6
** License as published by the Free Software Foundation; either
7
** version 2.1 of the License, or (at your option) any later version.
8
**
9
** This library is distributed in the hope that it will be useful,
10
** but WITHOUT ANY WARRANTY; without even the implied warranty of
11
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
** Lesser General Public License for more details.
13
**
14
** You should have received a copy of the GNU Lesser General Public
15
** License along with this library; if not, write to the Free Software
16
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*/
18
19
#
include
"LoadLibraryWrapper.hpp"
20
21
#
include
"../../../core/ttypes.hpp"
22
23
// Networking functionality such as browsing.
24
#
include
<
lm
.
h
>
25
// AT job scheduling structure.
26
#
include
<
lmat
.
h
>
27
28
namespace
jmmcg
{
namespace
LIBJMMCG_VER_NAMESPACE
{
namespace
NTUtils
{
29
30
class
LoadLibraryWrapper;
31
32
class
AFX_EXT_CLASS
ScheduledTask
:
virtual
protected
LoadLibraryWrapper
{
33
public
:
34
__stdcall
ScheduledTask
(
void
);
35
__stdcall
~
ScheduledTask
(
void
);
36
37
bool
__fastcall
AddJob
(
const
std
::
wstring
&
machine
,
const
AT_INFO
&
at
,
unsigned
long
&
id
);
38
bool
__fastcall
DeleteJob
(
const
std
::
wstring
&
machine
,
const
unsigned
long
id
);
39
static
tstring
__fastcall
Time
(
const
unsigned
long
)
noexcept
(
true
);
40
41
private
:
42
typedef
NET_API_STATUS
(
NET_API_FUNCTION
*
const
NetScheduleJobAddType
)(
IN
LPCWSTR
Servername
OPTIONAL
,
IN
LPBYTE
Buffer
,
OUT
LPDWORD
JobId
);
43
typedef
NET_API_STATUS
(
NET_API_FUNCTION
*
const
NetScheduleJobDelType
)(
IN
LPCWSTR
Servername
OPTIONAL
,
IN
DWORD
MinJobId
,
IN
DWORD
MaxJobId
);
44
typedef
std
::
vector
<
std
::
pair
<
std
::
wstring
,
unsigned
long
> >
jobs_list_type
;
45
46
template
<
class
A
,
class
B
>
struct
SameObj
:
public
std
::
binary_function
<
A
,
B
,
bool
> {
47
inline
bool
__fastcall
operator
()(
const
A
&
x
,
const
B
&
y
)
const
{
48
return
!
x
.
first
.
compare
(
y
.
first
) &&
x
.
second
==
y
.
second
;
49
}
50
};
51
52
const
NetScheduleJobAddType
pNetScheduleJobAdd
;
53
const
NetScheduleJobDelType
pNetScheduleJobDel
;
54
55
jobs_list_type
jobs
;
56
57
// Stop any compiler silliness...
58
inline
ScheduledTask
(
const
ScheduledTask
&);
59
inline
ScheduledTask
&
__fastcall
operator
=(
const
ScheduledTask
&);
60
};
61
62
} } }
experimental
NT-based
NTSpecific
ScheduledTask.hpp
Generated on Tue May 11 2021 17:21:53 for libjmmcg by
1.9.2