本文整理汇总了C++中registerType函数的典型用法代码示例。如果您正苦于以下问题:C++ registerType函数的具体用法?C++ registerType怎么用?C++ registerType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了registerType函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plugin
JobManager::JobManager (LV2Plugin& p)
: plugin (p), forge (p.get_uris(), p.get_urid_map(), p.get_urid_unmap()),
workForge (p.get_uris(), p.get_urid_map(), p.get_urid_unmap())
{
registerType (new ObjectDisposalJobType ());
registerType (new MediaLoaderJobType ());
}
示例2: Plugin
WeatherPlugin::WeatherPlugin(unsigned base, bool bInit, Buffer *config)
: Plugin(base)
{
load_data(weatherData, &data, config);
BarWeather = registerType();
CmdWeather = registerType();
EventWeather = registerType();
m_icons = getIcons()->addIconSet("icons/weather.jisp", true);
Event eBar(EventToolbarCreate, (void*)BarWeather);
eBar.process();
Command cmd;
cmd->id = CmdWeather;
cmd->text = I18N_NOOP("Not connected");
cmd->icon = "weather";
cmd->bar_id = BarWeather;
cmd->bar_grp = 0x1000;
cmd->flags = BTN_PICT | BTN_DIV;
Event eCmd(EventCommandCreate, cmd);
eCmd.process();
m_bar = NULL;
if (!bInit){
showBar();
if (m_bar)
m_bar->show();
}
}
示例3: Plugin
MSNPlugin::MSNPlugin(unsigned base)
: Plugin(base)
{
MSNPacket = registerType();
EventAddOk = registerType();
EventAddFail = registerType();
MSNInitMail = registerType();
MSNNewMail = registerType();
getContacts()->addPacketType(MSNPacket, msn_descr.text, true);
m_protocol = new MSNProtocol(this);
}
示例4: Plugin
ActionPlugin::ActionPlugin(unsigned base)
: Plugin(base), EventReceiver(HighPriority)
{
plugin = this;
action_data_id = getContacts()->registerUserData(info.title, actionUserData);
CmdAction = registerType();
Command cmd;
cmd->id = action_data_id + 1;
cmd->text = I18N_NOOP("&Action");
cmd->icon = "run";
cmd->param = (void*)getActionSetup;
Event e(EventAddPreferences, cmd);
e.process();
cmd->id = CmdAction;
cmd->text = "_";
cmd->icon = NULL;
cmd->flags = COMMAND_CHECK_STATE;
cmd->menu_id = MenuContact;
cmd->menu_grp = 0xC000;
cmd->param = NULL;
Event eCmd(EventCommandCreate, cmd);
eCmd.process();
Event ePlugin(EventGetPluginInfo, (void*)"_core");
pluginInfo *info = (pluginInfo*)(ePlugin.process());
core = static_cast<CorePlugin*>(info->plugin);
}
示例5: registComponentType
void BaseGameFeatureUnit::registComponentType()
{
FeatureUnit::registComponentType();
auto objfactory = ObjectFactory::getInstance();
objfactory->registerType(CREATE_CLASS_COMPONENT_INFO(AttributeComponent));
}
示例6: registerType
CoreROIFactory::CoreROIFactory() {
registerType(new ROICube());
registerType(new ROICylinder());
registerType(new ROISphere());
registerType(new ROIRaster());
registerType(new ROIUnion());
registerType(new ROISubstract());
registerType(new ROIGraph());
}
示例7: registerType
void Engine::setAutoCast(int target, QList< int > origin, TypeCast castfunc, int prio)
{
if(castfunc==0)return;
if(prio<0)return;
registerType(target);
Private::CastFunc_s cf(prio);
cf.cfunc=castfunc;
cf.origin=origin;
cf.target=target;
d->casts.append(cf);
}
示例8: RsClassType
RsClassType& TypeSystem::getClassType(const std::string& name, size_t sz /*= 0*/, bool uniontype /*= false*/)
{
RsClassType& entry = classMap[name];
if (entry.invalid())
{
entry = RsClassType(name, sz, uniontype);
registerType(entry);
}
return entry;
}
示例9: to
/*
This method is "over generalized" to allow us to (potentially) register more types of things in
the future without adding exported symbols.
*/
int QQmlPrivate::qmlregister(RegistrationType type, void *data)
{
if (type == TypeRegistration) {
return registerType(*reinterpret_cast<RegisterType *>(data));
} else if (type == InterfaceRegistration) {
return registerInterface(*reinterpret_cast<RegisterInterface *>(data));
} else if (type == AutoParentRegistration) {
return registerAutoParentFunction(*reinterpret_cast<RegisterAutoParent *>(data));
} else if (type == SingletonRegistration) {
return registerSingletonType(*reinterpret_cast<RegisterSingletonType *>(data));
}
return -1;
}
示例10: _fPrototypeCreate
OSG_USING_NAMESPACE
/*-------------------------------------------------------------------------*/
/* Constructors */
/*! Constructor for a new field container type.
*
*/
FieldContainerType::FieldContainerType(
const Char8 *szName,
const Char8 *szParentName,
const Char8 *szGroupName,
const UInt32 uiNameSpace,
PrototypeCreateF fPrototypeCreate,
InitContainerF fInitMethod,
ExitContainerF fExitMethod,
InitalInsertDescFunc descInsertFunc,
bool bDescsAddable,
BitVector bvUnmarkedOnCreate,
std::string fcdXML,
std::string typeDoc) :
Inherited (szName,
szParentName,
szGroupName,
uiNameSpace,
descInsertFunc,
bDescsAddable,
bvUnmarkedOnCreate),
_baseType (IsFieldContainer ),
_pPrototype (NULL ),
_fPrototypeCreate(fPrototypeCreate ),
_fInitMethod (fInitMethod ),
_fExitMethod (fExitMethod ),
_fcdXML (fcdXML ),
_typeDoc (typeDoc )
{
registerType();
if(fInitMethod != NULL)
fInitMethod(Static);
}
示例11: Plugin
SMSPlugin::SMSPlugin(unsigned base)
: Plugin(base)
{
SerialPacket = registerType();
getContacts()->addPacketType(SerialPacket, "Serial port", true);
Command cmd;
cmd->id = MessagePhoneCall;
cmd->text = I18N_NOOP("Phone call");
cmd->icon = "phone";
cmd->flags = COMMAND_DEFAULT;
cmd->param = &defPhoneCall;
Event eMsg(EventCreateMessageType, cmd);
eMsg.process();
m_protocol = new SMSProtocol(this);
qApp->installEventFilter(this);
setPhoneCol();
}
示例12: parseID
QuantLib::Calendar Create<QuantLib::Calendar>::operator()(const std::string &id) {
idOriginal = id;
// Is this an ID for a Calendar or a JointCalendar?
if (testID()) {
// It's a JointCalendar. Parse the ID.
parseID();
// Does the requested JointCalendar already exist?
if (checkType(idFull)) {
// It does - return it.
return *(static_cast<QuantLib::Calendar*>(this->getType(idFull)));
} else {
// It doesn't - create it, add it to the registry, and return it.
QuantLib::Calendar *jointCalendar = makeJointCalendar(calendarIDs.size());
registerType(idFull, jointCalendar);
return *jointCalendar;
}
} else {
// the ID is for a Calendar - return it
return *(static_cast<QuantLib::Calendar*>(this->getType(id)));
}
}
示例13: main
int main(int argc, char *argv[])
{
c_bool isTransient, isPersistent;
c_bool isClosed = FALSE;
unsigned long i, j;
os_time os_delay2000 = { 2, 0 };
DDS_sequence_DurabilityData_Msg* DurabilityData_Msg_Seq = DDS_sequence_DurabilityData_Msg__alloc();
DDS_SampleInfoSeq* DurabilityData_infoSeq = DDS_SampleInfoSeq__alloc();
if( argc < 2 )
{
usage();
}
isTransient = (strcmp(argv[1], "transient") == 0) ? TRUE : FALSE;
isPersistent = (strcmp(argv[1], "persistent") == 0) ? TRUE : FALSE;
if( ! (isTransient || isPersistent) )
{
usage();
}
g_durability_kind = (char*) argv[1];
// Create DDS DomainParticipant
createParticipant("Durability example");
// Register the Topic's type in the DDS Domain.
g_MsgTypeSupport = DurabilityData_MsgTypeSupport__alloc();
checkHandle(g_MsgTypeSupport, "DurabilityData_MsgTypeSupport__alloc");
registerType(g_MsgTypeSupport);
// Create the Topic's in the DDS Domain.
g_MsgTypeName = (char*) DurabilityData_MsgTypeSupport_get_type_name(g_MsgTypeSupport);
createTopic("DurabilityData_Msg", g_MsgTypeName);
DDS_free(g_MsgTypeName);
DDS_free(g_MsgTypeSupport);
// Create the Subscriber's in the DDS Domain.
createSubscriber();
// Request a Reader from the the Subscriber.
createReader();
printf("=== [Subscriber] Ready ...");
// Added a max iteration threshold in order to avoid looping infinitely.
// This is in the case of "persistent" + auto_dispose == TRUE,
// if the user tries to use persistence feature, it won't succeed:
// with this setting value, the Instance is still deleted upon the delete of the Writer,
// even though the persistent setting has been passed on both processes.
i = 0;
do
{
g_status = DurabilityData_MsgDataReader_take(
g_DataReader,
DurabilityData_Msg_Seq,
DurabilityData_infoSeq,
DDS_LENGTH_UNLIMITED,
DDS_ANY_SAMPLE_STATE,
DDS_ANY_VIEW_STATE,
DDS_ANY_INSTANCE_STATE );
checkStatus(g_status, "DurabilityData_MsgDataReader_take");
if( DurabilityData_Msg_Seq->_length > 0 )
{
j = 0;
do
{
if( DurabilityData_infoSeq->_buffer[j].valid_data )
{
printf("\n%s", DurabilityData_Msg_Seq->_buffer[j].content);
if( strcmp(DurabilityData_Msg_Seq->_buffer[j].content, "9") == 0 )
{
isClosed = TRUE;
}
}
}
while( ++j < DurabilityData_Msg_Seq->_length );
DurabilityData_MsgDataReader_return_loan (g_DataReader, DurabilityData_Msg_Seq, DurabilityData_infoSeq);
}
os_nanoSleep(os_delay2000);
}
while( isClosed == FALSE && i++ < 5);
// Cleanup DDS from the created Entities.
deleteDataReader();
deleteSubscriber();
deleteTopic();
deleteParticipant();
// Cleanup C allocations, recursively freeing the allocated structures and sequences using the OpenSplice API.
DDS_free(DurabilityData_Msg_Seq);
DDS_free(DurabilityData_infoSeq);
// Print out an empty line, just to let behind a clean new line for the shell..
printf("\n");
return 0;
}
示例14: registerField
DocumentTypeManager::DocumentTypeManager () {
registerField ("title", _("Title"), false);
registerField ("author", _("Authors"), false);
registerField ("journal", _("Journal"), false);
registerField ("year", _("Year"), true);
registerField ("volume", _("Volume"), true);
registerField ("number", _("Issue"), true);
registerField ("pages", _("Pages"), true);
registerField ("month", _("Month"), true);
registerField ("note", _("Note"), false);
registerField ("key", _("Key"), true);
registerField ("editor", _("Editor"), false);
registerField ("publisher", _("Publisher"), false);
registerField ("series", _("Series"), false);
registerField ("address", _("Address"), false);
registerField ("edition", _("Edition"), false);
registerField ("booktitle", _("Book title"), false);
registerField ("organisation", _("Organisation"), false);
registerField ("howpublished", _("How published"), false);
registerField ("school", _("School"), false);
registerField ("institution", _("Institution"), false);
registerField ("chapter", _("Chapter"), false);
registerField ("type", _("Type"), false);
registerField ("doi", _("DOI"), false);
DocumentType article ("article", _("Article"));
addField (article, "title", true);
addField (article, "journal", true);
addField (article, "year", true);
addField (article, "author", true);
addField (article, "volume", false);
addField (article, "number", false);
addField (article, "pages", false);
addField (article, "doi", false);
// Fields John thinks are silly
/*
addField (article, "month", false);
addField (article, "note", false);
addField (article, "key", false);
*/
registerType (article);
DocumentType book ("book", _("Book"));
addField (book, "author", true);
addField (book, "editor", true);
addField (book, "title", true);
addField (book, "publisher", true);
addField (book, "year", true);
addField (book, "volume", false);
addField (book, "series", false);
addField (book, "address", false);
addField (book, "edition", false);
addField (book, "doi", false);
// Fields John thinks are silly
/*
addField (book, "month", false);
addField (book, "note", false);
addField (book, "key", false);
*/
registerType (book);
DocumentType inproceedings ("inproceedings", _("In Proceedings"));
addField (inproceedings, "author", true);
addField (inproceedings, "title", true);
addField (inproceedings, "booktitle", true);
addField (inproceedings, "year", true);
addField (inproceedings, "editor", false);
addField (inproceedings, "pages", false);
addField (inproceedings, "organisation", false);
addField (inproceedings, "publisher", false);
addField (inproceedings, "address", false);
addField (inproceedings, "doi", false);
/*
addField (inproceedings, "month", false);
addField (inproceedings, "note", false);
addField (inproceedings, "key", false);
*/
registerType (inproceedings);
DocumentType misc ("misc", _("Misc"));
addField (misc, "author", false);
addField (misc, "title", false);
addField (misc, "howpublished", false);
addField (misc, "month", false);
addField (misc, "year", false);
addField (misc, "note", false);
addField (misc, "key", false);
addField (misc, "doi", false);
registerType (misc);
DocumentType unpublished ("unpublished", _("Unpublished"));
addField (unpublished, "author", true);
addField (unpublished, "title", true);
addField (unpublished, "note", true);
//.........这里部分代码省略.........