latest changes from main repository

This commit is contained in:
Guenter Obiltschnig
2007-04-25 14:32:55 +00:00
parent 3e46ab332b
commit ba1384e12d
23 changed files with 344 additions and 134 deletions

View File

@@ -1,7 +1,7 @@
//
// AbstractCache.h
//
// $Id: //poco/Main/Foundation/include/Poco/AbstractCache.h#13 $
// $Id: //poco/Main/Foundation/include/Poco/AbstractCache.h#14 $
//
// Library: Foundation
// Package: Cache
@@ -50,6 +50,7 @@
#include "Poco/SharedPtr.h"
#include <map>
#include <set>
#include <cstddef>
namespace Poco {

View File

@@ -1,7 +1,7 @@
//
// DynamicAnyHolder.h
//
// $Id: //poco/Main/Foundation/include/Poco/DynamicAnyHolder.h#3 $
// $Id: //poco/Main/Foundation/include/Poco/DynamicAnyHolder.h#4 $
//
// Library: Poco
// Package: Core
@@ -211,6 +211,7 @@ class DynamicAnyHolderImpl: public DynamicAnyHolder
/// RangeException (if an attempt is made to assign a numeric value outside of the target min/max limits
/// SyntaxException (if an attempt is made to convert a string containing non-numeric characters to number)
{
public:
DynamicAnyHolderImpl()
{
}

View File

@@ -1,7 +1,7 @@
//
// HashTable.h
//
// $Id: //poco/Main/Foundation/include/Poco/HashTable.h#8 $
// $Id: //poco/Main/Foundation/include/Poco/HashTable.h#9 $
//
// Library: Foundation
// Package: Hashing
@@ -46,7 +46,7 @@
#include "Poco/HashStatistic.h"
#include <vector>
#include <map>
#include <stddef.h>
#include <cstddef>
namespace Poco {
@@ -293,7 +293,7 @@ public:
return _entries[hsh] && (_entries[hsh]->end() != _entries[hsh]->find(key));
}
size_t size() const
std::size_t size() const
/// Returns the number of elements already inserted into the HashTable
{
return _size;
@@ -379,8 +379,8 @@ public:
private:
HashTableVector _entries;
size_t _size;
UInt32 _maxCapacity;
std::size_t _size;
UInt32 _maxCapacity;
KeyHashFunction _hash;
};

View File

@@ -1,7 +1,7 @@
//
// LRUStrategy.h
//
// $Id: //poco/Main/Foundation/include/Poco/LRUStrategy.h#4 $
// $Id: //poco/Main/Foundation/include/Poco/LRUStrategy.h#5 $
//
// Library: Foundation
// Package: Cache
@@ -47,6 +47,7 @@
#include "Poco/Exception.h"
#include <list>
#include <map>
#include <cstddef>
namespace Poco {
@@ -65,7 +66,7 @@ public:
typedef typename KeyIndex::const_iterator ConstIndexIterator;
public:
LRUStrategy(size_t size):
LRUStrategy(std::size_t size):
_size(size)
{
if (_size < 1) throw InvalidArgumentException("size must be > 0");
@@ -127,16 +128,16 @@ public:
// Note: replace only informs the cache which elements
// it would like to remove!
// it does not remove them on its own!
size_t curSize = _keyIndex.size();
std::size_t curSize = _keyIndex.size();
if (curSize < _size)
{
return;
}
size_t diff = curSize - _size;
std::size_t diff = curSize - _size;
Iterator it = --_keys.end(); //--keys can never be invoked on an empty list due to the minSize==1 requirement of LRU
size_t i = 0;
std::size_t i = 0;
while (i++ < diff)
{
@@ -149,9 +150,9 @@ public:
}
protected:
size_t _size; /// Number of keys the cache can store.
Keys _keys;
KeyIndex _keyIndex; /// For faster access to _keys
std::size_t _size; /// Number of keys the cache can store.
Keys _keys;
KeyIndex _keyIndex; /// For faster access to _keys
};

View File

@@ -1,7 +1,7 @@
//
// SharedMemory.h
//
// $Id: //poco/Main/Foundation/include/Poco/SharedMemory.h#3 $
// $Id: //poco/Main/Foundation/include/Poco/SharedMemory.h#4 $
//
// Library: Poco
// Package: Processes
@@ -42,6 +42,7 @@
#include "Poco/Poco.h"
#include <algorithm>
#include <cstddef>
namespace Poco {

View File

@@ -1,7 +1,7 @@
//
// SharedMemoryImpl.cpp
//
// $Id: //poco/Main/Foundation/src/SharedMemory_POSIX.cpp#7 $
// $Id: //poco/Main/Foundation/src/SharedMemory_POSIX.cpp#8 $
//
// Library: Poco
// Package: Processes
@@ -55,6 +55,10 @@ SharedMemoryImpl::SharedMemoryImpl(const std::string& name, std::size_t size, Sh
_name("/"),
_fileMapped(false)
{
#if POCO_OS == POCO_OS_HPUX
_name.append("tmp/");
#endif
_name.append(name);
int flags = O_CREAT;