Skip to content

Commit 072ba74

Browse files
committed
changes for 1.2.5
1 parent 5638037 commit 072ba74

35 files changed

Lines changed: 276 additions & 184 deletions

‎CHANGELOG‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
This is the changelog file for POCO - the C++ Portable Components.
22

3-
Release 1.2.5 (2006-10-xx)
3+
Release 1.2.5 (2006-10-23)
44
==========================
55

66
- Improved LoggingConfigurator: channel creation and configuration is now a two-step process.
@@ -14,6 +14,20 @@ Release 1.2.5 (2006-10-xx)
1414
- improved ThreadPool performance
1515
- XML now compiles with -DXML_UNICODE_WCHAR_T (SF# 1575174)
1616
- fixed SF# 1572757: HTML forms can have more than one key/value pair with the same name
17+
- got rid of the dynamic casts in Events, Events/Cache: simpler/faster Delegate < operator,
18+
prevents some rare dynamic casts error from occuring when using StrategyCollection with Caches
19+
- improvements to Logger and LoggingConfigurator:
20+
* added Logger::unsafeGet()
21+
* added Logger::setProperty(loggerName, propertyName, value)
22+
* LoggingConfigurator now correctly (re)configures existing Loggers
23+
(prior to this change, if a Logger named "a.b.c" existed before
24+
the LoggingConfigurator started its work, and the LoggingConfigurator
25+
configured a Logger named "a.b", then "a.b.c" would not inherit
26+
the new configuration).
27+
- improvements to SplitterChannel and EventLogChannel configuration
28+
- improved LoggingRegistry exception messages
29+
- MessageHeader::read() is more liberal with malformed message headers.
30+
This fixes problems with certain network cameras sending malformed HTTP headers.
1731

1832

1933
Release 1.2.4 (2006-10-02)
@@ -529,4 +543,4 @@ building the libraries.
529543

530544

531545
--
532-
$Id: //poco/1.2/dist/CHANGELOG#10 $
546+
$Id: //poco/1.2/dist/CHANGELOG#13 $

‎CONTRIBUTORS‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Peter Schojer <peter.schojer@appinf.com>
44
Claus Dabringer <claus.dabringer@appinf.com>
55
Andrew Marlow (public@marlowa.plus.com)
66
Caleb Epstein (caleb.epstein@gmail.com)
7+
Andrew J. P. Maclean (a.maclean@optusnet.com.au)
78

89
--
9-
$Id: //poco/1.2/dist/CONTRIBUTORS#1 $
10+
$Id: //poco/1.2/dist/CONTRIBUTORS#2 $

‎Foundation/include/Poco/AbstractCache.h‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// AbstractCache.h
33
//
4-
// $Id: //poco/1.2/Foundation/include/Poco/AbstractCache.h#3 $
4+
// $Id: //poco/1.2/Foundation/include/Poco/AbstractCache.h#4 $
55
//
66
// Library: Foundation
77
// Package: Cache
@@ -124,6 +124,25 @@ class AbstractCache
124124
doClear();
125125
}
126126

127+
std::size_t size() const
128+
/// Returns the number of cached elements
129+
{
130+
FastMutex::ScopedLock lock(_mutex);
131+
return _data.size();
132+
}
133+
134+
void forceReplace()
135+
/// Forces cache replacement. Note that Poco's cache strategy use for efficiency reason no background thread
136+
/// which periodically triggers cache replacement. Cache Replacement is only started when the cache is modified
137+
/// from outside, i.e. add is called, or when a user tries to access an cache element via get.
138+
/// In some cases, i.e. expire based caching where for a long time no access to the cache happens,
139+
/// it might be desirable to be able to trigger cache replacement manually.
140+
{
141+
FastMutex::ScopedLock lock(_mutex);
142+
doReplace();
143+
}
144+
145+
127146
protected:
128147
mutable BasicEvent<ValidArgs<TKey> > IsValid;
129148
mutable BasicEvent<KeySet> Replace;

‎Foundation/include/Poco/AbstractDelegate.h‎

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// AbstractDelegate.h
33
//
4-
// $Id: //poco/1.2/Foundation/include/Poco/AbstractDelegate.h#1 $
4+
// $Id: //poco/1.2/Foundation/include/Poco/AbstractDelegate.h#2 $
55
//
66
// Library: Foundation
77
// Package: Events
@@ -54,8 +54,14 @@ class AbstractDelegate
5454
/// instead of run-time checks.
5555
{
5656
public:
57-
AbstractDelegate()
57+
AbstractDelegate(void* pTarget): _pTarget(pTarget)
5858
{
59+
poco_assert_dbg (_pTarget != 0);
60+
}
61+
62+
AbstractDelegate(const AbstractDelegate& del):_pTarget(del._pTarget)
63+
{
64+
poco_assert_dbg (_pTarget != 0);
5965
}
6066

6167
virtual ~AbstractDelegate()
@@ -68,8 +74,19 @@ class AbstractDelegate
6874
virtual AbstractDelegate* clone() const = 0;
6975
/// Returns a deep-copy of the AbstractDelegate
7076

71-
virtual bool operator < (const AbstractDelegate<TArgs>& other) const = 0;
77+
bool operator < (const AbstractDelegate<TArgs>& other) const
7278
/// For comparing AbstractDelegates in a collection.
79+
{
80+
return _pTarget < other._pTarget;
81+
}
82+
83+
void* target() const
84+
{
85+
return _pTarget;
86+
}
87+
88+
protected:
89+
void* _pTarget;
7390
};
7491

7592

‎Foundation/include/Poco/AbstractEvent.h‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// AbstractEvent.h
33
//
4-
// $Id: //poco/1.2/Foundation/include/Poco/AbstractEvent.h#1 $
4+
// $Id: //poco/1.2/Foundation/include/Poco/AbstractEvent.h#3 $
55
//
66
// Library: Foundation
77
// Package: Events
@@ -211,7 +211,7 @@ class AbstractEvent
211211
/// the next notify. If one of the delegates throws an exception, the execution
212212
/// is aborted and the exception is reported to the caller.
213213
{
214-
NotifyAsyncParams params;
214+
NotifyAsyncParams params(pSender, args);
215215

216216
{
217217
FastMutex::ScopedLock lock(_mutex);
@@ -223,8 +223,6 @@ class AbstractEvent
223223
// between notifyAsync and the execution of the method no changes can occur
224224

225225
params.ptrStrat = SharedPtr<TStrategy>(new TStrategy(_strategy));
226-
params.pSender = pSender;
227-
params.args = args;
228226
params.enabled = _enabled;
229227
}
230228

@@ -267,7 +265,13 @@ class AbstractEvent
267265
const void* pSender;
268266
TArgs args;
269267
bool enabled;
268+
269+
NotifyAsyncParams(const void* pSend, const TArgs& a):ptrStrat(), pSender(pSend), args(a), enabled(true)
270+
/// default constructor reduces the need for TArgs to have an empty constructor, only copy constructor is needed.
271+
{
272+
}
270273
};
274+
271275
ActiveMethod<TArgs, NotifyAsyncParams, AbstractEvent> _executeAsync;
272276

273277
TArgs executeAsyncImpl(const NotifyAsyncParams& par)
@@ -278,7 +282,7 @@ class AbstractEvent
278282
}
279283

280284
NotifyAsyncParams params = par;
281-
TArgs retArgs = params.args;
285+
TArgs retArgs(params.args);
282286
params.ptrStrat->notify(params.pSender, retArgs);
283287
return retArgs;
284288
}

‎Foundation/include/Poco/AbstractPriorityDelegate.h‎

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// AbstractPriorityDelegate.h
33
//
4-
// $Id: //poco/1.2/Foundation/include/Poco/AbstractPriorityDelegate.h#1 $
4+
// $Id: //poco/1.2/Foundation/include/Poco/AbstractPriorityDelegate.h#2 $
55
//
66
// Library: Foundation
77
// Package: Events
@@ -54,7 +54,15 @@ class AbstractPriorityDelegate
5454
/// instead of run-time checks.
5555
{
5656
public:
57-
AbstractPriorityDelegate()
57+
AbstractPriorityDelegate(void* pTarget, int prio):
58+
_pTarget(pTarget),
59+
_priority(prio)
60+
{
61+
}
62+
63+
AbstractPriorityDelegate(const AbstractPriorityDelegate& del):
64+
_pTarget(del._pTarget),
65+
_priority(del._priority)
5866
{
5967
}
6068

@@ -68,8 +76,30 @@ class AbstractPriorityDelegate
6876
virtual AbstractPriorityDelegate* clone() const = 0;
6977
// Returns a deep-copy of the object.
7078

71-
virtual bool operator < (const AbstractPriorityDelegate<TArgs>& other) const = 0;
79+
bool operator < (const AbstractPriorityDelegate<TArgs>& other) const
7280
/// Operator used for comparing AbstractPriorityDelegates in a collection.
81+
{
82+
if (_priority == other._priority)
83+
{
84+
return _pTarget < other._pTarget;
85+
}
86+
87+
return (_priority < other._priority);
88+
}
89+
90+
void* target() const
91+
{
92+
return _pTarget;
93+
}
94+
95+
int priority() const
96+
{
97+
return _priority;
98+
}
99+
100+
protected:
101+
void* _pTarget;
102+
int _priority;
73103
};
74104

75105

‎Foundation/include/Poco/Delegate.h‎

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// Delegate.h
33
//
4-
// $Id: //poco/1.2/Foundation/include/Poco/Delegate.h#1 $
4+
// $Id: //poco/1.2/Foundation/include/Poco/Delegate.h#3 $
55
//
66
// Library: Foundation
77
// Package: Events
@@ -55,12 +55,14 @@ class Delegate: public AbstractDelegate<TArgs>
5555
typedef void (TObj::*NotifyMethod)(const void*, TArgs&);
5656

5757
Delegate(TObj* obj, NotifyMethod method):
58+
AbstractDelegate<TArgs>(obj),
5859
_receiverObject(obj),
5960
_receiverMethod(method)
6061
{
6162
}
6263

6364
Delegate(const Delegate& delegate):
65+
AbstractDelegate<TArgs>(delegate),
6466
_receiverObject(delegate._receiverObject),
6567
_receiverMethod(delegate._receiverMethod)
6668
{
@@ -74,8 +76,9 @@ class Delegate: public AbstractDelegate<TArgs>
7476
{
7577
if (&delegate != this)
7678
{
77-
_receiverObject = delegate._receiverObject;
78-
_receiverMethod = delegate._receiverMethod;
79+
this->_pTarget = delegate._pTarget;
80+
this->_receiverObject = delegate._receiverObject;
81+
this->_receiverMethod = delegate._receiverMethod;
7982
}
8083
return *this;
8184
}
@@ -91,20 +94,6 @@ class Delegate: public AbstractDelegate<TArgs>
9194
return new Delegate(*this);
9295
}
9396

94-
bool operator < (const AbstractDelegate<TArgs>& other) const
95-
{
96-
const Delegate<TObj, TArgs>* pOther = dynamic_cast<const Delegate<TObj, TArgs>*>(&other);
97-
98-
if (pOther == 0)
99-
{
100-
const Expire<TArgs>* pExpire = dynamic_cast<const Expire<TArgs>*>(&other);
101-
poco_check_ptr(pExpire);
102-
return this->operator < (pExpire->getDelegate());
103-
}
104-
105-
return _receiverObject < pOther->_receiverObject;
106-
}
107-
10897
protected:
10998
TObj* _receiverObject;
11099
NotifyMethod _receiverMethod;

‎Foundation/include/Poco/EventLogChannel.h‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// EventLogChannel.h
33
//
4-
// $Id: //poco/1.2/Foundation/include/Poco/EventLogChannel.h#1 $
4+
// $Id: //poco/1.2/Foundation/include/Poco/EventLogChannel.h#2 $
55
//
66
// Library: Foundation
77
// Package: Logging
@@ -88,16 +88,18 @@ class Foundation_API EventLogChannel: public Channel
8888
///
8989
/// The following properties are supported:
9090
///
91-
/// * name: The name of the event source.
92-
/// * host: The name of the host where the Event Log service is running.
93-
/// The default is "localhost".
94-
/// * logFile: The name of the log file. The default is "Application".
91+
/// * name: The name of the event source.
92+
/// * loghost: The name of the host where the Event Log service is running.
93+
/// The default is "localhost".
94+
/// * host: same as host.
95+
/// * logfile: The name of the log file. The default is "Application".
9596

9697
std::string getProperty(const std::string& name) const;
9798
/// Returns the value of the given property.
9899

99100
static const std::string PROP_NAME;
100101
static const std::string PROP_HOST;
102+
static const std::string PROP_LOGHOST;
101103
static const std::string PROP_LOGFILE;
102104

103105
protected:

0 commit comments

Comments
 (0)