/usr/include/tjutils/tjembed.h is in libodin-dev 1.8.8-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | /***************************************************************************
tjembed.h - description
-------------------
begin : Tue Mar 11 2003
copyright : (C) 2000-2014 by Thies H. Jochimsen
email : thies@jochimsen.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TJEMBED_H
#define TJEMBED_H
#include <tjutils/tjutils.h>
#include <tjutils/tjstring.h> // for itos
/**
* @addtogroup tjutils
* @{
*/
template<class T,class E>
class Embed {
public:
Embed() {}
~Embed() {
clear_instances();
}
void clear_instances() {
for(typename STD_list<T*>::iterator it=instances.begin();it!=instances.end();++it) delete (*it);
instances.clear();
}
T& set_embed_body (const E& embeddedBody) {
T* embedptr=static_cast<T*>(this);
T* newinst;
if(embedptr) newinst=new T(*embedptr);
else newinst=new T();
newinst->set_body(embeddedBody);
newinst->set_label(STD_string(newinst->get_label())+itos(instances.size()));
instances.push_back(newinst);
return *newinst;
}
T& set_embed_body (E& embeddedBody) {
T* embedptr=static_cast<T*>(this);
T* newinst;
if(embedptr) newinst=new T(*embedptr);
else newinst=new T();
newinst->set_body(embeddedBody);
newinst->set_label(STD_string(newinst->get_label())+itos(instances.size()));
instances.push_back(newinst);
return *newinst;
}
typedef typename STD_list<T*>::iterator institer;
institer get_inst_begin() {return instances.begin();}
institer get_inst_end() {return instances.end();}
typedef typename STD_list<T*>::const_iterator constinstiter;
constinstiter get_const_inst_begin() const {return instances.begin();}
constinstiter get_const_inst_end() const {return instances.end();}
private:
STD_list<T*> instances;
};
/** @}
*/
#endif
|