Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F4821488
attachments.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Aug 24, 12:14 PM
Size
733 B
Mime Type
text/x-c
Expires
Wed, Aug 26, 12:14 PM (1 d, 7 h)
Engine
blob
Format
Raw Data
Handle
286757
Attached To
rXR Xreate
attachments.cpp
View Options
//
// Created by pgess on 3/15/15.
//
#include "attachments.h"
#include "ast.h"
void xreate::SymbolAttachments::put(xreate::Symbol const &symbol, unsigned int key, void *data) {
symbol.scope->attachments.__data[key].emplace(symbol.identifier, data);
}
void *xreate::SymbolAttachments::get(xreate::Symbol const &symbol, unsigned int key, void *def) {
if (symbol.scope->attachments.__data[key].count(symbol.identifier))
return symbol.scope->attachments.__data[key].at(symbol.identifier);
return def;
}
bool
xreate::SymbolAttachments::exists(const Symbol& symbol, unsigned int key)
{
return symbol.scope->attachments.__data.count(key) && symbol.scope->attachments.__data.at(key).count(symbol.identifier);
}
Event Timeline
Log In to Comment