Home » Developing U++ » U++ Developers corner » Question: Simple plugin implementation
Re: Question: Simple plugin implementation [message #30873 is a reply to message #30862] |
Thu, 27 January 2011 10:34   |
 |
koldo
Messages: 3432 Registered: August 2008
|
Senior Veteran |
|
|
Hello Mirek
A little bit better (not as rich as StreamRaster, but clearer for me ). Added "new" instead of ugly global var:
#include <Core/Core.h>
using namespace Upp;
#include "Spreadsheet.h"
class ExcelSpreadsheet : public SpreadsheetPlugin {
Spreadsheet_METHOD_LIST
};
INITBLOCK {
RegisterPlugin<ExcelSpreadsheet>("Excel");
}
bool ExcelSpreadsheet::Open(const char *filename) {
puts("ExcelSpreadsheet::Open");
return false;
}
bool ExcelSpreadsheet::SetData(int row, int col, Value val) {
puts("ExcelSpreadsheet::SetData");
return false;
}
However all possible plugins are initialized, not just the one to be used.
It is the same in class StreamRaster (file Raster.h):
template <class T> static StreamRaster *FactoryFn() { return new T; }
Every registered class has to be initialized.
[Edit: Simplified INITBLOCK with templates]
Best regards
IƱaki
[Updated on: Thu, 27 January 2011 13:07] Report message to a moderator
|
|
|
 |
|
Question: Simple plugin implementation
By: koldo on Sun, 23 January 2011 22:20
|
 |
|
Re: Question: Simple plugin implementation
By: mirek on Sun, 23 January 2011 23:53
|
 |
|
Re: Question: Simple plugin implementation
By: koldo on Mon, 24 January 2011 09:44
|
 |
|
Re: Question: Simple plugin implementation
By: koldo on Tue, 25 January 2011 14:50
|
 |
|
Re: Question: Simple plugin implementation
By: mirek on Tue, 25 January 2011 15:34
|
 |
|
Re: Question: Simple plugin implementation
By: koldo on Thu, 27 January 2011 10:34
|
 |
|
Re: Question: Simple plugin implementation
By: koldo on Thu, 27 January 2011 13:58
|
 |
|
Re: Question: Simple plugin implementation
By: fudadmin on Thu, 27 January 2011 17:34
|
 |
|
Re: Question: Simple plugin implementation
By: mirek on Thu, 27 January 2011 20:54
|
 |
|
Re: Question: Simple plugin implementation
By: mirek on Thu, 27 January 2011 20:53
|
 |
|
Re: Question: Simple plugin implementation
By: koldo on Thu, 27 January 2011 21:47
|
 |
|
Re: Question: Simple plugin implementation
By: mirek on Fri, 28 January 2011 10:33
|
 |
|
Re: Question: Simple plugin implementation
By: mirek on Fri, 28 January 2011 10:34
|
 |
|
Re: Question: Simple plugin implementation
By: koldo on Sat, 29 January 2011 01:08
|
 |
|
Re: Question: Simple plugin implementation
By: koldo on Mon, 07 February 2011 11:16
|
 |
|
Re: Question: Simple plugin implementation
By: mirek on Fri, 11 February 2011 16:50
|
 |
|
Re: Question: Simple plugin implementation
By: koldo on Fri, 11 February 2011 22:47
|
Goto Forum:
Current Time: Mon Apr 28 10:48:53 CEST 2025
Total time taken to generate the page: 0.00962 seconds
|