Home » Developing U++ » U++ Developers corner » What about LUA plugin?
Re: What about LUA plugin? [message #5221 is a reply to message #5220] |
Mon, 11 September 2006 00:24   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
Quote: |
struct XmlIO {
template<class T> XmlIO& operator()(const char* tag, T& v)
{ std::cout << "<" << tag << ">" << v << "<\\" << tag << ">"; return *this; }
};
|
It is bidirectional, so cout does not make it, however I see the point...
Quote: |
#define SERIALIZABLE(Class) template<class stream> friend stream& operator<<(stream&, Class&);
// End user code
class C {
int v1, v2;
SERIALIZABLE(Class);
public:
C() : v1(12), v2(24) {}
};
|
Yep. But using macro is ugly and requires more typing. Instead, there is
template <class T> XmlIO XmlIO::operator()(const char *tag, T& var) {
XmlIO n(*this, tag);
Xmlize(n, var);
return *this;
}
soo if you want to be aspect aware, which I understand as being able to add xmlization to existing class, simply define Xmlize *function* for it.
Xmlize itself has template
template <class T>
void Xmlize(XmlIO xml, T& var)
{
var.Xmlize(xml);
}
(Now if somebody asks what we mean by "aggresive use of C++", here is the answer).
Note that sometimes you might want to define more funtions to xmlize single type to express the value the type really represents, e.g. there is XmlizeLang that interprets int as language indentifier (e.g. "en-us").
Quote: |
About a uppforge, why waiting high demand? Won't the offer create demand? At least, this shall only encourage sharing U++ code, thus giving more examples of U++ code. Maybe just letting a space where to put code snipset would be nice.
|
What I really wanted to say is that U++ is not popular enough for somebody to start one. If you feel like starting such effort, go for it, it will definitely help us.
Mirek
|
|
|
 |
|
What about LUA plugin?
By: mirek on Tue, 22 August 2006 18:50
|
 |
|
Re: What about LUA plugin?
By: fudadmin on Tue, 22 August 2006 21:28
|
 |
|
Re: What about LUA plugin?
By: masu on Tue, 22 August 2006 23:01
|
 |
|
Re: What about LUA plugin?
By: mirek on Wed, 23 August 2006 00:13
|
 |
|
Re: What about LUA plugin?
By: unodgs on Tue, 22 August 2006 23:07
|
 |
|
Re: What about LUA plugin?
By: fudadmin on Tue, 22 August 2006 23:40
|
 |
|
Re: What about LUA plugin?
By: thierry on Sun, 10 September 2006 16:16
|
 |
|
Re: What about LUA plugin?
By: thierry on Sun, 10 September 2006 16:44
|
 |
|
Re: What about LUA plugin?
By: mirek on Sun, 10 September 2006 18:56
|
 |
|
Re: What about LUA plugin?
By: mirek on Sun, 10 September 2006 19:11
|
 |
|
Re: What about LUA plugin?
By: thierry on Sun, 10 September 2006 19:45
|
 |
|
Re: What about LUA plugin?
By: mirek on Sun, 10 September 2006 20:50
|
 |
|
Re: What about LUA plugin?
By: thierry on Sun, 10 September 2006 23:47
|
 |
|
Re: What about LUA plugin?
By: mirek on Mon, 11 September 2006 00:24
|
 |
|
Re: What about LUA plugin?
By: thierry on Mon, 11 September 2006 01:10
|
 |
|
Re: What about LUA plugin?
By: mirek on Mon, 11 September 2006 01:22
|
 |
|
Re: What about LUA plugin?
By: thierry on Mon, 11 September 2006 01:39
|
 |
|
Re: What about LUA plugin?
By: mirek on Mon, 11 September 2006 01:49
|
 |
|
Re: What about LUA plugin?
By: qwerty on Mon, 11 September 2006 01:12
|
 |
|
Re: What about LUA plugin?
By: qwerty on Mon, 11 September 2006 01:21
|
 |
|
Re: What about LUA plugin?
By: mirek on Mon, 11 September 2006 01:24
|
 |
|
Re: What about LUA plugin?
By: qwerty on Mon, 11 September 2006 01:51
|
 |
|
Re: What about LUA plugin?
By: mirek on Mon, 11 September 2006 08:59
|
 |
|
Re: What about LUA plugin?
By: qwerty on Mon, 11 September 2006 11:38
|
 |
|
Re: What about LUA plugin?
By: lindquist on Sun, 17 September 2006 17:46
|
 |
|
Re: What about LUA plugin?
By: qwerty on Sun, 15 October 2006 09:48
|
Goto Forum:
Current Time: Thu Aug 14 04:24:34 CEST 2025
Total time taken to generate the page: 0.15312 seconds
|