FACT++  1.0
bool fits::SetPtrAddress ( const std::string &  name,
void *  ptr,
size_t  cnt = 0 
)
inline

Definition at line 973 of file fits.h.

References fits::Table::cols, and str.

974  {
975  if (fTable.cols.count(name)==0)
976  {
977  std::ostringstream str;
978  str <<"SetPtrAddress('" << name << "') - Column not found.";
979  Exception(str.str());
980  return false;
981  }
982 
983  if (cnt && cnt!=fTable.cols[name].num)
984  {
985  std::ostringstream str;
986  str << "SetPtrAddress('" << name << "') - Element count mismatch: expected "
987  << fTable.cols[name].num << " from header, got " << cnt;
988  Exception(str.str());
989  return false;
990  }
991 
992  // if (fAddresses.count(ptr)>0)
993  // gLog << warn << "SetPtrAddress('" << name << "') - Pointer " << ptr << " already assigned." << endl;
994 
995  //fAddresses[ptr] = fTable.cols[name];
996  fPointers[name] = ptr;
997  fAddresses.emplace_back(ptr, fTable.cols[name]);
998  sort(fAddresses.begin(), fAddresses.end(), Compare);
999  return true;
1000  }
char str[80]
Definition: test_client.c:7
static bool Compare(const Address &p1, const Address &p2)
Definition: fits.h:862
Columns cols
Definition: fits.h:116
Table fTable
Definition: fits.h:502
Pointers fPointers
Definition: fits.h:507
void Exception(const std::string &txt)
Definition: fits.h:484
Addresses fAddresses
Definition: fits.h:505