#include <iostream>
#define NUMDATASETS 10
#define NUMDATAS 10
static int create_example(const char* srcfile)
{
try
{
object = factory->
create(srcfile);
for (int i=0; i<NUMDATASETS; i++)
{
for (int j=0; j<NUMDATAS; j++)
{
delete data;
}
delete dataset;
}
std::cout << "Esecuzione terminata" << std::endl;
}
catch (std::exception& stde)
{
std::cerr << "Errore di esecuzione: " << stde.what() << std::endl;
}
catch (...)
{
std::cerr << "Errore sconociuto" << std::endl;
}
delete dumper;
delete object;
delete factory;
return 0;
}
static int remove_example(const char* srcfile)
{
try
{
object = factory->
open(srcfile);
delete dataset;
object->removeDataset(5);
std::cout << "Esecuzione terminata" << std::endl;
}
catch (std::exception& stde)
{
std::cerr << "Errore di esecuzione: " << stde.what() << std::endl;
}
catch (...)
{
std::cerr << "Errore sconociuto" << std::endl;
}
delete dumper;
delete object;
delete factory;
return 0;
}
int main(int argc, char* argv[])
{
if (argc != 2)
{
std::cout << "Usage: " << argv[0] << " <odimh5file>" << std::endl;
return -1;
}
try
{
create_example(argv[1]);
remove_example(argv[1]);
}
catch (...)
{
}
getchar();
return 0;
}
Generic OdimH5 v2.0 data group.
Definition odimh5v20_classes.hpp:380
virtual MetadataGroup * getWhat()
Get the WHAT attributes group.
Definition odimh5v20_classes.cpp:480
Generic OdimH5 v2.0 dataset group.
Definition odimh5v20_classes.hpp:257
virtual OdimData * createData()
Create a new group 'data' inside this dataset.
Definition odimh5v20_classes.cpp:373
virtual void removeData(int index)
Remove a 'data' group from this dataset.
Definition odimh5v20_classes.cpp:404
virtual MetadataGroup * getWhat()
Get the WHAT attributes group.
Definition odimh5v20_classes.cpp:347
OdimH5 objects factory.
Definition odimh5v20_factory.hpp:50
virtual OdimObject * open(const std::string &path)
Get a OdimH5 object from an existing file.
Definition odimh5v20_factory.cpp:112
virtual OdimObjectDumper * getDumper()
Create a dumper for OdimH5 objects.
Definition odimh5v20_factory.cpp:360
virtual OdimObject * create(const std::string &path)
Create a new generic OdimH5 object and the associated file.
Definition odimh5v20_factory.cpp:48
OdimH5 object dumper.
Definition odimh5v20_dump.hpp:52
virtual void dump(OdimObject *object)
Dump object informations to standard output.
Definition odimh5v20_dump.cpp:48
Generic OdimH5 v2.0 object.
Definition odimh5v20_classes.hpp:95
virtual void setObject(const std::string &val)
Set the value of 'object' attribute.
Definition odimh5v20_classes.cpp:293
Namespace related to ODIMH5 version 2.0.
Definition odimh5v20.hpp:46
Main header file of the library.