17 #include "RelationalAccess/ICursor.h"
19 #include "CoralBase/Attribute.h"
20 #include "CoralBase/AttributeList.h"
21 #include "CoralBase/AttributeSpecification.h"
28 ,
const std::string& tableName)
30 , m_tableName(tableName)
34 m_values->fastCopyData (attList);
36 for(
unsigned int i=0;
i<m_values->size();
i++) {
37 std::string
key = (*m_values)[
i].specification().name();
66 if(
values[
it->second].specification().type()==
typeid(
int)) {
67 return values[
it->second].data<
int>();
69 else if(
values[
it->second].specification().type()==
typeid(long)) {
70 return (
int)
values[
it->second].data<
long>();
73 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of integer type\n");
85 if(
values[
it->second].specification().type()==
typeid(
long)) {
86 return values[
it->second].data<
long>();
88 else if(
values[
it->second].specification().type()==
typeid(
int)) {
89 return (
long)
values[
it->second].data<
int>();
91 else if(
values[
it->second].specification().type()==
typeid(
long long)) {
92 return (
long)
values[
it->second].data<
long long>();
95 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of long type");
107 if(
values[
it->second].specification().type()==
typeid(
double)) {
108 return values[
it->second].data<
double>();
111 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of double type");
123 if(
values[
it->second].specification().type()==
typeid(
float)) {
124 return values[
it->second].data<
float>();
127 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of float type");
139 if(
values[
it->second].specification().type()==
typeid(std::string)) {
140 return values[
it->second].data<std::string>();
143 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of string type");
155 if(
values[
it->second].specification().type()==
typeid(
int)) {
156 return values[
it->second].data<
int>();
158 else if(
values[
it->second].specification().type()==
typeid(long)) {
159 return (
int)
values[
it->second].data<
long>();
162 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of integer type\n");
174 if(
values[
it->second].specification().type()==
typeid(
long)) {
175 return values[
it->second].data<
long>();
177 else if(
values[
it->second].specification().type()==
typeid(
int)) {
178 return (
long)
values[
it->second].data<
int>();
181 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of long type");
193 if(
values[
it->second].specification().type()==
typeid(
double)) {
194 return values[
it->second].data<
double>();
197 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of double type");
209 if(
values[
it->second].specification().type()==
typeid(
float)) {
210 return values[
it->second].data<
float>();
213 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of float type");
225 if(
values[
it->second].specification().type()==
typeid(std::string)) {
226 return values[
it->second].data<std::string>();
229 throw std::runtime_error(
"Field " +
fieldName +
" is NOT of string type");
238 if(myAttList.size()!=rhsAttList.size())
return true;
240 for(
size_t i(0);
i<myAttList.size(); ++
i) {
241 const coral::Attribute& myAtt = myAttList[
i];
242 const std::string
name = myAtt.specification().name();
244 for(
size_t j(0); j<rhsAttList.size(); ++j) {
245 const coral::Attribute& rhsAtt = rhsAttList[j];
246 if(rhsAtt.specification().name()==
name) {
262 m_values->toOutputStream(
os);