Main Page
Namespaces
Classes
Files
File List
File Members
MamdaQuery.h
Go to the documentation of this file.
1
/* $Id$
2
*
3
* OpenMAMA: The open middleware agnostic messaging API
4
* Copyright (C) 2011 NYSE Technologies, Inc.
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
* 02110-1301 USA
20
*/
21
22
#ifndef MamdaUtilsH
23
#define MamdaUtilsH
24
25
#include <
mamda/MamdaConfig.h
>
26
27
namespace
Wombat
28
{
29
30
class
MamdaNewsQueryHandler;
31
class
MamaDateTime;
32
class
MamdaSubscription;
33
34
class
MAMDAExpDLL
MamdaQuery
35
{
36
37
public
:
38
virtual
bool
getXML (
char
*result) = 0;
39
40
bool
getQuery (
char
*&result);
41
virtual
int
getDepth () = 0;
42
43
struct
QueryImpl;
44
struct
CondImpl;
45
struct
QueryInfoImpl;
46
47
void
setSubscriptionInfo (
MamdaSubscription
* subscInfo);
48
MamdaSubscription
* getSubscriptionInfo ();
49
50
protected
:
51
MamdaQuery
();
52
53
private
:
54
QueryInfoImpl& mInfoImpl;
55
};
56
57
58
class
MAMDAExpDLL
MamdaOrQuery
:
public
MamdaQuery
59
{
60
public
:
61
MamdaOrQuery
(
MamdaQuery
* query1,
MamdaQuery
* query2);
62
63
bool
getXML (
char
* result);
64
int
getDepth ();
65
void
addQuery (
MamdaQuery
* query1);
66
67
private
:
68
QueryImpl& mImpl;
69
};
70
71
72
class
MAMDAExpDLL
MamdaAndQuery
:
public
MamdaQuery
73
{
74
public
:
75
MamdaAndQuery
(
MamdaQuery
* query1,
MamdaQuery
* query2);
76
77
bool
getXML (
char
* result);
78
int
getDepth ();
79
void
addQuery (
MamdaQuery
* query1);
80
81
private
:
82
QueryImpl& mImpl;
83
};
84
85
86
class
MAMDAExpDLL
MamdaEqualsQuery
:
public
MamdaQuery
87
{
88
public
:
89
MamdaEqualsQuery
(
const
char
* field,
const
char
* val);
90
MamdaEqualsQuery
(
const
char
* field,
double
val);
91
MamdaEqualsQuery
(
const
char
* field,
int
val);
92
MamdaEqualsQuery
(
const
char
* field,
bool
val);
93
94
bool
addItem (
const
char
* item);
95
bool
addItem (
double
item);
96
bool
addItem (
int
item);
97
bool
addItem (
bool
item);
98
99
bool
getXML (
char
* result);
100
int
getDepth ();
101
102
private
:
103
CondImpl& mImpl;
104
};
105
106
107
class
MAMDAExpDLL
MamdaDateQuery
:
public
MamdaQuery
108
{
109
public
:
110
MamdaDateQuery
(MamaDateTime& start,
111
MamaDateTime& end);
112
113
bool
getXML (
char
*result);
114
int
getDepth ();
115
116
private
:
117
CondImpl& mImpl;
118
};
119
120
121
class
MAMDAExpDLL
MamdaContainsAllQuery
:
public
MamdaQuery
122
{
123
public
:
124
MamdaContainsAllQuery
(
const
char
*field,
const
char
* item);
125
MamdaContainsAllQuery
(
const
char
*field,
double
item);
126
MamdaContainsAllQuery
(
const
char
*field,
int
item);
127
128
bool
addItem (
const
char
* item);
129
bool
addItem (
double
item);
130
bool
addItem (
int
item);
131
132
bool
getXML (
char
* result);
133
int
getDepth ();
134
135
private
:
136
CondImpl& mImpl;
137
};
138
139
140
class
MAMDAExpDLL
MamdaContainsQuery
:
public
MamdaQuery
141
{
142
public
:
143
MamdaContainsQuery
(
const
char
* field,
const
char
* item);
144
MamdaContainsQuery
(
const
char
* field,
const
double
item);
145
MamdaContainsQuery
(
const
char
* field,
int
item);
146
147
bool
addItem (
const
char
* item);
148
bool
addItem (
double
item);
149
bool
addItem (
int
item);
150
bool
addItem (
bool
item);
151
152
bool
getXML (
char
* result);
153
int
getDepth ();
154
155
private
:
156
CondImpl& mImpl;
157
};
158
159
}
//namespace
160
161
#endif
162
163
164
© 2012 Linux Foundation