524 |
return m_data->isLazy(); |
return m_data->isLazy(); |
525 |
} |
} |
526 |
|
|
527 |
|
// at the moment this is synonymous with !isLazy() but that could change |
528 |
|
bool |
529 |
|
Data::isReady() const |
530 |
|
{ |
531 |
|
return (dynamic_cast<DataReady*>(m_data.get())!=0); |
532 |
|
} |
533 |
|
|
534 |
|
|
535 |
void |
void |
536 |
Data::setProtection() |
Data::setProtection() |
566 |
// do nothing |
// do nothing |
567 |
} else if (isEmpty()) { |
} else if (isEmpty()) { |
568 |
throw DataException("Error - Expansion of DataEmpty not possible."); |
throw DataException("Error - Expansion of DataEmpty not possible."); |
569 |
|
} else if (isLazy()) { |
570 |
|
DataReady_ptr res=m_data->resolve(); |
571 |
|
m_data=res; |
572 |
} else { |
} else { |
573 |
throw DataException("Error - Expansion not implemented for this Data type."); |
throw DataException("Error - Expansion not implemented for this Data type."); |
574 |
} |
} |
2418 |
return m_data.get(); |
return m_data.get(); |
2419 |
} |
} |
2420 |
|
|
|
|
|
2421 |
std::string |
std::string |
2422 |
Data::toString() const |
Data::toString() const |
2423 |
{ |
{ |
2457 |
DataTypes::ValueType::const_reference |
DataTypes::ValueType::const_reference |
2458 |
Data::getDataPoint(int sampleNo, int dataPointNo) const |
Data::getDataPoint(int sampleNo, int dataPointNo) const |
2459 |
{ |
{ |
2460 |
if (isLazy()) |
if (!isReady()) |
2461 |
{ |
{ |
2462 |
throw DataException("Programmer error - getDataPoint() not permitted on Lazy Data."); |
throw DataException("Programmer error - getDataPoint() not permitted on Lazy Data."); |
2463 |
} |
} |
2472 |
DataTypes::ValueType::reference |
DataTypes::ValueType::reference |
2473 |
Data::getDataPoint(int sampleNo, int dataPointNo) |
Data::getDataPoint(int sampleNo, int dataPointNo) |
2474 |
{ |
{ |
2475 |
if (isLazy()) |
if (!isReady()) |
2476 |
{ |
{ |
2477 |
throw DataException("Programmer error - getDataPoint() not permitted on Lazy Data."); |
throw DataException("Programmer error - getDataPoint() not permitted on Lazy Data."); |
2478 |
} |
} |