本文整理汇总了C++中CBGetObject函数的典型用法代码示例。如果您正苦于以下问题:C++ CBGetObject函数的具体用法?C++ CBGetObject怎么用?C++ CBGetObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CBGetObject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CBInitStringByCopyingCString
bool CBInitStringByCopyingCString(CBString * self,char * string){
self->string = malloc(strlen(string));
strcpy(self->string,string);
if (!CBInitObject(CBGetObject(self)))
return false;
return true;
}
示例2: CBInitByteArraySubReference
void CBInitByteArraySubReference(CBByteArray * self, CBByteArray * ref, uint32_t offset, uint32_t length) {
CBInitObject(CBGetObject(self), false);
self->sharedData = ref->sharedData;
self->sharedData->references++; // Since a new reference to the shared data is being made, an increase in the reference count must be made.
self->length = length;
self->offset = ref->offset + offset;
}
示例3: CBNewStringByTakingCString
CBString * CBNewStringByTakingCString(char * string){
objectNum++;
CBString * self = malloc(sizeof(*self));
CBAddVTToObject(CBGetObject(self), &VTStore, CBCreateStringVT);
CBInitStringByTakingCString(self,string);
return self;
}
示例4: CBNewScript
CBScript * CBNewScript(CBNetworkParameters * params,CBByteArray * program,CBEvents * events){
CBScript * self = malloc(sizeof(*self));
objectNum++;
CBAddVTToObject(CBGetObject(self), &VTStore, CBCreateScriptVT);
CBInitScript(self,params,program,events);
return self;
}
示例5: CBNewNode
CBNode * CBNewNode(CBDepObject database, CBNodeFlags flags, CBNodeCallbacks nodeCallbacks, CBNetworkCommunicatorCallbacks commCallbacks, CBOnMessageReceivedAction (*onMessageReceived)(CBNode *, CBPeer *, CBMessage *)){
CBNode * self = malloc(sizeof(*self));
CBGetObject(self)->free = CBFreeNode;
if (CBInitNode(self, database, flags, nodeCallbacks, commCallbacks, onMessageReceived))
return self;
free(self);
return NULL;
}
示例6: CBInitByteArrayWithData
void CBInitByteArrayWithData(CBByteArray * self, uint8_t * data, uint32_t size) {
CBInitObject(CBGetObject(self), false);
self->sharedData = malloc(sizeof(*self->sharedData));
self->sharedData->data = data;
self->sharedData->references = 1;
self->length = size;
self->offset = 0;
}
示例7: CBNewBlockHeadersFromData
CBBlockHeaders * CBNewBlockHeadersFromData(CBByteArray * data) {
CBBlockHeaders * self = malloc(sizeof(*self));
CBGetObject(self)->free = CBFreeBlockHeaders;
CBInitBlockHeadersFromData(self, data);
return self;
}
示例8: CBNewBlockHeaders
CBBlockHeaders * CBNewBlockHeaders() {
CBBlockHeaders * self = malloc(sizeof(*self));
CBGetObject(self)->free = CBFreeBlockHeaders;
CBInitBlockHeaders(self);
return self;
}
示例9: CBNewInventoryFromData
CBInventory * CBNewInventoryFromData(CBByteArray * data) {
CBInventory * self = malloc(sizeof(*self));
CBGetObject(self)->free = CBFreeInventory;
CBInitInventoryFromData(self, data);
return self;
}
示例10: CBNewInventory
CBInventory * CBNewInventory() {
CBInventory * self = malloc(sizeof(*self));
CBGetObject(self)->free = CBFreeInventory;
CBInitInventory(self);
return self;
}
示例11: CBInitByteArrayFromString
void CBInitByteArrayFromString(CBByteArray * self, char * string, bool terminator) {
CBInitObject(CBGetObject(self), false);
self->length = (uint32_t)(strlen(string) + terminator);
self->sharedData = malloc(sizeof(*self->sharedData));
self->sharedData->data = malloc(self->length);
self->sharedData->references = 1;
self->offset = 0;
memcpy(self->sharedData->data, string, self->length);
}
示例12: CBNewAlert
CBAlert * CBNewAlert(int32_t version, int64_t relayUntil, int64_t expiration, int32_t ID, int32_t cancel, int32_t minVer, int32_t maxVer, int32_t priority, CBByteArray * hiddenComment, CBByteArray * displayedComment, CBByteArray * reserved) {
CBAlert * self = malloc(sizeof(*self));
CBGetObject(self)->free = CBFreeAlert;
CBInitAlert(self, version, relayUntil, expiration, ID, cancel, minVer, maxVer, priority, hiddenComment, displayedComment, reserved);
return self;
}
示例13: CBNewAlertFromData
CBAlert * CBNewAlertFromData(CBByteArray * data) {
CBAlert * self = malloc(sizeof(*self));
CBGetObject(self)->free = CBFreeAlert;
CBInitAlertFromData(self, data);
return self;
}
示例14: CBNewPingPongFromData
CBPingPong * CBNewPingPongFromData(CBByteArray * data) {
CBPingPong * self = malloc(sizeof(*self));
CBGetObject(self)->free = CBFreePingPong;
CBInitPingPongFromData(self, data);
return self;
}
示例15: CBNewPingPong
CBPingPong * CBNewPingPong(long long int ID) {
CBPingPong * self = malloc(sizeof(*self));
CBGetObject(self)->free = CBFreePingPong;
CBInitPingPong(self, ID);
return self;
}