Back to index

texmacs  1.0.7.15
Classes | Defines | Functions
resource.hpp File Reference
#include "string.hpp"
#include "hashmap.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  rep< T >
class  resource_ptr< R >

Defines

#define RESOURCE(PTR)
#define RESOURCE_CODE(PTR)   template<> hashmap<string,pointer> resource_ptr<PTR##_rep>::instances (NULL);
#define make(T, s, im)   ((T::instances -> contains (s))? T(s): T(im))

Functions

template<class R >
bool is_nil (const resource_ptr< R > &res)
template<class R >
tm_ostreamoperator<< (tm_ostream &out, const resource_ptr< R > &t)
template<class T >
tm_ostreamoperator<< (tm_ostream &out, const resource_ptr< T > &t)

Define Documentation

#define make (   T,
  s,
  im 
)    ((T::instances -> contains (s))? T(s): T(im))

Definition at line 66 of file resource.hpp.

#define RESOURCE (   PTR)
Value:
struct PTR##_rep;                                    \
template<> hashmap<string,pointer> resource_ptr<PTR##_rep>::instances; \
struct PTR : public resource_ptr<PTR##_rep> {       \
  inline PTR (PTR##_rep* rep2= NULL) { rep=rep2; }  \
  inline PTR (string s) { rep=(PTR##_rep*) instances [s]; } \
  inline ~PTR() {}                                  \
}

Definition at line 42 of file resource.hpp.

#define RESOURCE_CODE (   PTR)    template<> hashmap<string,pointer> resource_ptr<PTR##_rep>::instances (NULL);

Definition at line 56 of file resource.hpp.


Function Documentation

template<class R >
bool is_nil ( const resource_ptr< R > &  res) [inline]

Definition at line 61 of file resource.hpp.

{ return res.rep == NULL; }
template<class R >
tm_ostream& operator<< ( tm_ostream out,
const resource_ptr< R > &  t 
)
template<class T >
tm_ostream& operator<< ( tm_ostream out,
const resource_ptr< T > &  t 
)

Definition at line 69 of file resource.hpp.

                                                                    {
  return out << t->res_name;
}