dtinfo subtree DtMmdb

This commit is contained in:
Ulrich Wilkens
2012-10-14 15:38:27 +02:00
committed by Jon Trulson
parent b92cf08899
commit 8c8363f4a5
184 changed files with 1090 additions and 773 deletions

View File

@@ -23,7 +23,7 @@ XCOMM .../programs/dtinfo/mmdb/<subdir>/Imakefile
#define LargePICTable YES
#define CplusplusSource YES
DEPEND_DEFINES = $(CXXDEPENDINCLUDES)
DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
XCOMM In DtMmdb we compile as C_API sources.
DEFINES = -DC_API -DPORTABLE_DB

View File

@@ -76,7 +76,7 @@ btree_index::~btree_index()
delete v_idx_agent_ptr;
}
int btree_index::handler_to_inv_idx(const handler& query)
size_t btree_index::handler_to_inv_idx(const handler& query)
{
get_key_string(query);
@@ -85,7 +85,7 @@ int btree_index::handler_to_inv_idx(const handler& query)
if ( v_idx_agent_ptr -> member(k) == false )
throw(stringException("first_of_invlist(): key is not in btree"));
return int(k.dt);
return size_t(k.dt);
}

View File

@@ -65,7 +65,7 @@ public:
//init run time data members
Boolean init_data_member( inv_lists_handler*, const char* btree_store );
int handler_to_inv_idx(const handler& query);
size_t handler_to_inv_idx(const handler& query);
MMDB_SIGNATURES(btree_index);
};

View File

@@ -72,7 +72,7 @@ dyn_disk_index::init_data_member(inv_lists_handler* y, abs_storage* store)
return true;
}
int dyn_disk_index::handler_to_inv_idx(const handler&)
size_t dyn_disk_index::handler_to_inv_idx(const handler&)
{
throw(stringException("handler_to_int() not implemented"));
return 0;

View File

@@ -65,7 +65,7 @@ public:
//init run time data components
Boolean init_data_member( inv_lists_handler*, abs_storage* );
int handler_to_inv_idx(const handler&);
size_t handler_to_inv_idx(const handler&);
MMDB_SIGNATURES(dyn_disk_index);
};

View File

@@ -160,7 +160,7 @@ MESSAGE(cerr, "insert to list after");
(*v_inv_lists_hd) -> append_list(list);
intKey.dt = voidPtr((*v_inv_lists_hd) -> count());
intKey.dt = (voidPtr)(size_t)(*v_inv_lists_hd) -> count();
//debug(cerr, int(intKey.dt));
v_idx_agent_ptr -> insert( intKey );

View File

@@ -93,7 +93,7 @@ dyn_memory_index::~dyn_memory_index()
char buf[PATHSIZ];
for ( int i=0; i<PATHSIZ; buf[i++]=0 );
ostrstream oid_t_out(buf, PATHSIZ);
ostringstream oid_t_out(buf, PATHSIZ);
my_oid().asciiOut(oid_t_out);
*/
@@ -106,7 +106,7 @@ dyn_memory_index::~dyn_memory_index()
}
}
int dyn_memory_index::handler_to_inv_idx(const handler&)
size_t dyn_memory_index::handler_to_inv_idx(const handler&)
{
throw(stringException(
"dyn_memory_index::handler_to_int(): not implemented yet"

View File

@@ -67,7 +67,7 @@ public:
//init run time data components
Boolean init_data_member( inv_lists_handler*, abs_storage* );
int handler_to_inv_idx(const handler&);
size_t handler_to_inv_idx(const handler&);
virtual Boolean remove_loc(handler&, const oid_t&);
virtual Boolean remove_loc(const oid_t&, const oid_t&);

View File

@@ -398,11 +398,14 @@ Boolean fast_mphf::build(istream& in)
throw(stringException("finding a mphf failed"));
}
istrstream strin(mphf_spec.get_base(), mphf_spec.content_sz());
stringstream strin;
if ( !strin ) {
throw(streamException(strin.rdstate()));
}
else {
strin.write(mphf_spec.get_base(), mphf_spec.content_sz());
}
asciiIn(strin);

View File

@@ -107,10 +107,11 @@ oid_t c_index::first_of_invlist(int ind)
Boolean c_index::get_key_string(const handler& t) const
{
ostrstream out(v_static_key.get(), v_static_key.alloc_size());
ostringstream out(v_static_key.get());
((handler&)t) -> asciiOut(out);
v_static_key.set_size(out.pcount());
v_static_key.set_size(out.str().size());
strcpy(v_static_key.get(), out.str().c_str());
return true;
}
@@ -119,10 +120,11 @@ Boolean c_index::get_key_string(const oid_t& t) const
{
v_static_key.reset();
ostrstream out(v_static_key.get(), v_static_key.alloc_size());
ostringstream out(v_static_key.get());
t.asciiOut(out);
v_static_key.set_size(out.pcount());
v_static_key.set_size(out.str().size());
strcpy(v_static_key.get(), out.str().c_str());
return true;
}

View File

@@ -52,9 +52,9 @@
#define _index_h 1
#ifdef C_API
#include "utility/c_strstream.h"
#include "utility/c_stringstream.h"
#else
#include <strstream.h>
#include <sstream>
#endif
#include "object/oid_list.h"
@@ -100,7 +100,7 @@ public:
virtual int invlist_length(handler&) = 0;
// translate a query to an index of an inv_list
virtual int handler_to_inv_idx(const handler& query) = 0;
virtual size_t handler_to_inv_idx(const handler& query) = 0;
// status inquiry functions
int bound_to() const { return v_cmp_selector; } ;

View File

@@ -151,7 +151,7 @@ MESSAGE(cerr, "inv::insert");
debug(cerr, index);
*/
if ( INRANGE(list_id.ccode(), 0, 1) &&
if ( INRANGE((short)list_id.ccode(), 0, 1) &&
id.ccode() != OID_LIST_CODE
) {

View File

@@ -193,7 +193,7 @@ oid_list_handler* mphf_index::get_loc_list(const oid_t& )
return 0;
}
int mphf_index::handler_to_inv_idx(const handler& t)
size_t mphf_index::handler_to_inv_idx(const handler& t)
{
get_key_string(t);
//debug(cerr, v_static_key);
@@ -224,7 +224,7 @@ Boolean mphf_index::batch_index_begin()
{
/*
MESSAGE(cerr, "batch_index_begin()");
debug(cerr, cmp_selector);
debug(cerr, v_cmp_selector);
debug(cerr, count());
debug(cerr, int(this));
*/

View File

@@ -97,7 +97,7 @@ public:
virtual oid_t first_of_invlist(const handler&);
//
int handler_to_inv_idx(const handler& query);
size_t handler_to_inv_idx(const handler& query);
// status inquiry functions
virtual Boolean sorted() const { return false; };