本文整理汇总了C++中container函数的典型用法代码示例。如果您正苦于以下问题:C++ container函数的具体用法?C++ container怎么用?C++ container使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了container函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: runWhenSceneIsReady
/******************************************************************************
* This function blocks until the scene has become ready.
******************************************************************************/
bool DataSet::waitUntilSceneIsReady(const QString& message, QProgressDialog* progressDialog)
{
std::atomic_flag keepWaiting;
keepWaiting.test_and_set();
runWhenSceneIsReady( [&keepWaiting]() {
keepWaiting.clear();
} );
return container()->waitUntil([&keepWaiting]() {
return !keepWaiting.test_and_set();
}, message, progressDialog);
}
开发者ID:taohonker,项目名称:Ovito,代码行数:15,代码来源:DataSet.cpp
示例2: container
void Visualisation::initContainer()
{
Container container(Dimensions(10, 4, 5), 1);
IPackageGenerator* generator = new PackageGenerator(container.getDimensions(), 10, 5);
if(loader != nullptr)
delete loader;
loader = new ContainerLoader(container, generator);
delete generator;
}
开发者ID:krabex,项目名称:ContainerLoadingProblem-AI_UWr,代码行数:12,代码来源:Visualisation.cpp
示例3: main
int main(int argc, char* argv[]) {
if(argc != 2) {
std::cout << "Usage : " << argv[0] << " <movie | pic>" << std::endl;
return 0;
}
bool movie = std::string(argv[1])=="movie";
// random seed initialization
std::srand(std::time(0));
// Let us create a dictionary...
auto dict = gaml::span::dictionary<Point>(NU,gaussian_kernel);
// ... and adjust it so that it spans the distribution.
for(unsigned int nb = 0; nb < NB_SAMPLES; ++nb) dict.submit(get_sample());
std::cout << dict.container().size() << " samples added."<< std::endl;
Graph som;
Similarity distance;
UnitSimilarity unit_distance(distance);
Learn learning_rule;
UnitLearn unit_learning_rule(learning_rule);
WinnerTakeMost competition;
std::cout << "Processing SOM..." << std::endl;
auto line = vq2::algo::make::line(som,K,
[&dict](unsigned int w) -> Feature {return dict(Point(0,0));},
[](unsigned int w, unsigned int ww) -> char {return ' ';});
unsigned int k = 0;
for(auto& ref_vertex : line) (*ref_vertex).stuff.label = k++;
competition.coef = WIDE_COEF;
for(unsigned int nb = 0; nb < NB_EPOCHS; ++nb) {
if(nb == START_NARROW_EPOCH) competition.coef = NARROW_COEF;
for(unsigned int e = 0; e < EPOCH_SIZE; ++e)
vq2::algo::som::step(som,unit_distance,competition,
unit_learning_rule,
LEARNING_RATE,
dict(get_sample()));
if(movie) {
std::ostringstream filename;
filename << "som-" << std::setw(6) << std::setfill('0') << nb << ".ppm";
plot(som,unit_distance,dict,filename.str());
}
}
if(!movie)
plot(som,unit_distance,dict,"som.ppm");
return 0;
}
开发者ID:gpichot,项目名称:gaml,代码行数:53,代码来源:example-001-002-som.cpp
示例4: main
int main (int argc, const char * argv[])
{
int port = DEFAULT_PORT;
int bufferSize = DEFAULT_BUFFER_SIZE;
bool isQuiet = DEFAULT_QUIET;
bool isDebug = DEFAULT_DEBUG;
int maxClient = DEFAULT_MAXCLIENT;
signal(SIGINT, signalHandler);
signal(SIGTERM, signalHandler);
readArgs(argc,argv,&port,&bufferSize,&isQuiet,&isDebug,&maxClient);
logger.setQuiet(isQuiet);
logger.setDebug(isDebug);
if(!isQuiet)
{
printInfo(port,bufferSize,isDebug,maxClient);
}
List<Client*> list;
sf::Mutex listMutex;
sf::SocketSelector selector;
Buffer exchangeBuffer;
setupExchangeBuffer(&exchangeBuffer, bufferSize);
logger.printLog("Init'ed ...");
ClientsContainer container(&list,&listMutex,&selector);
sf::Thread answerThread(&answerToClient,AnswerDataSet(&container,port,maxClient));
answerThread.launch();
sf::Thread checkThread(&checkForInputs,CheckDataSet(&container,&exchangeBuffer));
checkThread.launch();
while(1) //TODO graphic stats
{
if(checkStopThreads())
{
break;
}
sf::sleep(sf::milliseconds(5));
}
return 0;
}
开发者ID:nessotrin,项目名称:Calculib2_server,代码行数:52,代码来源:main.cpp
示例5: test_table
void test_table(void) {
catdb::DBase::Database database("Billy_database");
catdb::DBase::Database database1("Johnny_database");
catdb::Column* temp = database.find_column("Cool");
std::cout << temp->display_list() << std::endl;
delete temp;
temp = NULL;
catdb::Container* container(new catdb::Container("Alex"));
catdb::Container container1("Billy");
catdb::Container container2("Fred");
catdb::Container container3("Zen");
container->insert_new_element("12.2", "Cool");
container1.insert_new_element("14.3", "Cool");
container2.insert_new_element("99.9", "Cool");
container3.insert_new_element("80.2", "Cool");
std::cout << container->obtain_element("12.2")->get_attribute() << std::endl;
// not implemented yet!!
database.add_container(container);
database.add_container(&container1);
database.add_container(&container2);
database.add_container(&container3);
std::cout << database.get_container("Alex")->get_container_name() << std::endl;
std::cout << "Here is a list of stuff in this column" << std::endl;
catdb::Column* column = database.find_column("Cool");
catdb::Element* element = column->inspect_element("12.2", "Cool");
column->sort_column(tools::sorting::quick_sort, tools::sorting::SORT_LITTLE_ENDIAN);
std::cout << column->display_list() << std::endl;
database.remove_container("Alex");
database.remove_container("Billy");
database.remove_container("Fred");
database.remove_container("Zen");
delete column;
column = NULL;
database1 = database;
catdb::GreaterComparator<catdb::Element> _g;
catdb::Comparator<catdb::Element>& _comp = catdb::LesserComparator<catdb::Element>();
catdb::Element el1("Cooler", "Bool", "Mang");
catdb::Element el2("Alex", "Benson", "Kol");
std::cout << _comp(el1, el2) << std::endl;
tools::data_structures::hash_map<int, int> mapping;
// if (database.get_container("Alex") == NULL)
// std::cout << "Alex is deleted!" << std::endl;
// database.folder_create();
// catdb::DBase::display_db_error_msg();
}
开发者ID:CheezBoiger,项目名称:CatDBMS,代码行数:52,代码来源:table_test.cpp
示例6: listenCallback
OCStackApplicationResult listenCallback(void* ctx, OCDoHandle handle,
OCClientResponse* clientResponse)
{
ClientCallbackContext::ListenContext* context =
static_cast<ClientCallbackContext::ListenContext*>(ctx);
if(clientResponse->result != OC_STACK_OK)
{
oclog() << "listenCallback(): failed to create resource. clientResponse: "
<< clientResponse->result
<< std::flush;
return OC_STACK_KEEP_TRANSACTION;
}
auto clientWrapper = context->clientWrapper.lock();
if(!clientWrapper)
{
oclog() << "listenCallback(): failed to get a shared_ptr to the client wrapper"
<< std::flush;
return OC_STACK_KEEP_TRANSACTION;
}
std::stringstream requestStream;
requestStream << clientResponse->resJSONPayload;
try
{
ListenOCContainer container(clientWrapper, *clientResponse->addr,
requestStream);
// loop to ensure valid construction of all resources
for(auto resource : container.Resources())
{
std::thread exec(context->callback, resource);
exec.detach();
}
}
catch(const std::exception& e)
{
oclog() << "listenCallback failed to parse a malformed message: "
<< e.what()
<< std::endl <<std::endl
<< clientResponse->result
<< std::flush;
return OC_STACK_KEEP_TRANSACTION;
}
return OC_STACK_KEEP_TRANSACTION;
}
开发者ID:TizenTeam,项目名称:iotivity,代码行数:52,代码来源:InProcClientWrapper.cpp
示例7: container
bool StateMachine::callState(const unsigned short newState, Object* const arg)
{
bool ok = false;
StateMachine* parent = dynamic_cast<StateMachine*>( container() );
if (parent != nullptr && sp > 0) {
ok = parent->call(newState,arg);
if (ok) {
stateStack[--sp] = state;
substateStack[sp] = substate;
}
}
return ok;
}
开发者ID:derekworth,项目名称:afit-swarm-simulation,代码行数:13,代码来源:StateMachine.cpp
示例8: containerCount
void TKAction::updateLayout()
{
int len = containerCount();
for( int id = 0; id < len; ++id ) {
QWidget* w = container( id );
if (w->inherits("KToolBar")) {
QWidget* r = static_cast<KToolBar*>(w)->getWidget(itemId(id));
if (qstrcmp(r->name(),"KTToolBarLayout")==0) {
updateLayout(r);
}
}
}
}
开发者ID:RainerBlessing,项目名称:KTagebuch,代码行数:13,代码来源:tkaction.cpp
示例9: buffer
void menu_dats_view::get_data()
{
std::vector<int> xstart, xend;
std::string buffer(mame_machine_manager::instance()->lua()->call_plugin(util::string_format("%d", m_items_list[m_actual].option).c_str(), "data"));
auto lines = ui().wrap_text(container(), buffer.c_str(), 0.0f, 0.0f, 1.0f - (4.0f * UI_BOX_LR_BORDER), xstart, xend);
for (int x = 0; x < lines; ++x)
{
std::string tempbuf(buffer.substr(xstart[x], xend[x] - xstart[x]));
item_append(tempbuf, "", (FLAG_UI_DATS | FLAG_DISABLE), (void *)(uintptr_t)(x + 1));
}
}
开发者ID:goofwear,项目名称:mame,代码行数:13,代码来源:datmenu.cpp
示例10: listenCallback
OCStackApplicationResult listenCallback(void* ctx, OCDoHandle /*handle*/,
OCClientResponse* clientResponse)
{
ClientCallbackContext::ListenContext* context =
static_cast<ClientCallbackContext::ListenContext*>(ctx);
if(clientResponse->result != OC_STACK_OK)
{
/* oclog() << "listenCallback(): failed to create resource. clientResponse: "
<< clientResponse->result
<< std::flush;*/
return OC_STACK_KEEP_TRANSACTION;
}
if(!clientResponse->payload)
{
oclog() << "listenCallback(): clientResponse payload was null"
<< std::flush;
return OC_STACK_KEEP_TRANSACTION;
}
if(clientResponse->payload->type != PAYLOAD_TYPE_DISCOVERY)
{
oclog() << "listenCallback(): clientResponse payload was the wrong type"
<< std::flush;
oclog() << "Type is: %i" << clientResponse->payload->type << std::flush;
return OC_STACK_KEEP_TRANSACTION;
}
auto clientWrapper = context->clientWrapper.lock();
if(!clientWrapper)
{
oclog() << "listenCallback(): failed to get a shared_ptr to the client wrapper"
<< std::flush;
return OC_STACK_KEEP_TRANSACTION;
}
ListenOCContainer container(clientWrapper, clientResponse->devAddr,
reinterpret_cast<OCDiscoveryPayload*>(clientResponse->payload));
// loop to ensure valid construction of all resources
for(auto resource : container.Resources())
{
std::thread exec(context->callback, resource);
exec.detach();
}
return OC_STACK_KEEP_TRANSACTION;
}
开发者ID:santais,项目名称:iotivity,代码行数:51,代码来源:InProcClientWrapper.cpp
示例11: oleWindow
STDMETHODIMP
HippoExplorerBar::SetSite(IUnknown *site)
{
site_ = NULL;
if (site)
{
// Get the window from the parent
HippoQIPtr<IOleWindow> oleWindow(site);
if (!oleWindow)
return E_FAIL;
HWND parentWindow = NULL;
HRESULT hr = oleWindow->GetWindow(&parentWindow);
if (FAILED (hr))
return hr;
if (!parentWindow)
return E_FAIL;
if (FAILED(site->QueryInterface<IInputObjectSite>(&site_)))
return E_FAIL;
HippoQIPtr<IServiceProvider> serviceProvider = site_;
if (serviceProvider)
serviceProvider->QueryService<IWebBrowser2>(SID_SWebBrowserApp, &browser_);
if (browser_) {
HippoQIPtr<IConnectionPointContainer> container(browser_);
if (container)
{
if (SUCCEEDED(container->FindConnectionPoint(DIID_DWebBrowserEvents2,
&connectionPoint_)))
{
// The COM-safe downcast here is a little overkill ...
// we actually just need to disambiguate
HippoQIPtr<IUnknown> unknown(static_cast<IDispatch *>(this));
connectionPoint_->Advise(unknown, &connectionCookie_);
}
}
}
if (!createWindow(parentWindow)) {
site_ = NULL;
return E_FAIL;
}
createIE();
}
return S_OK;
}
开发者ID:nihed,项目名称:magnetism,代码行数:51,代码来源:HippoExplorerBar.cpp
示例12: ui
void menu_display_actual::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
float width, maxwidth = origx2 - origx1;
float lineh = ui().get_line_height();
for (auto & elem : m_folders)
{
ui().draw_text_full(container(), elem.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::LEFT, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white(), rgb_t::black(), &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
maxwidth = std::max(maxwidth, width);
}
// get the size of the text
ui().draw_text_full(container(), m_tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NONE, rgb_t::white(), rgb_t::black(), &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
maxwidth = std::max(width, maxwidth);
// compute our bounds
float x1 = 0.5f - 0.5f * maxwidth;
float x2 = x1 + maxwidth;
float y1 = origy1 - top;
float y2 = y1 + lineh + 2.0f * UI_BOX_TB_BORDER;
// draw a box
ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_GREEN_COLOR);
// take off the borders
x1 += UI_BOX_LR_BORDER;
x2 -= UI_BOX_LR_BORDER;
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container(), m_tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
// compute our bounds
x1 = 0.5f - 0.5f * maxwidth;
x2 = x1 + maxwidth;
y1 = y2 + 2.0f * UI_BOX_TB_BORDER;
y2 = origy1 - UI_BOX_TB_BORDER;
// draw a box
ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_BACKGROUND_COLOR);
// take off the borders
x1 += UI_BOX_LR_BORDER;
x2 -= UI_BOX_LR_BORDER;
y1 += UI_BOX_TB_BORDER;
// draw the text within it
for (auto & elem : m_folders)
{
ui().draw_text_full(container(), elem.c_str(), x1, y1, x2 - x1, ui::text_layout::LEFT, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
y1 += lineh;
}
}
开发者ID:Robbbert,项目名称:store1,代码行数:58,代码来源:dirmenu.cpp
示例13: ui
void submenu::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
float width;
ui().draw_text_full(container(), _(m_options[0].description), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
float maxwidth = std::max(origx2 - origx1, width);
// compute our bounds
float x1 = 0.5f - 0.5f * maxwidth;
float x2 = x1 + maxwidth;
float y1 = origy1 - top;
float y2 = origy1 - UI_BOX_TB_BORDER;
// draw a box
ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_GREEN_COLOR);
// take off the borders
x1 += UI_BOX_LR_BORDER;
x2 -= UI_BOX_LR_BORDER;
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container(), _(m_options[0].description), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
if (selectedref != nullptr)
{
option &selected_sm_option = *reinterpret_cast<option *>(selectedref);
if (selected_sm_option.entry != nullptr)
{
ui().draw_text_full(container(), selected_sm_option.entry->description(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = std::max(origx2 - origx1, width);
// compute our bounds
x1 = 0.5f - 0.5f * maxwidth;
x2 = x1 + maxwidth;
y1 = origy2 + UI_BOX_TB_BORDER;
y2 = origy2 + bottom;
// draw a box
ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_RED_COLOR);
// take off the borders
x1 += UI_BOX_LR_BORDER;
x2 -= UI_BOX_LR_BORDER;
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container(), selected_sm_option.entry->description(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
}
}
开发者ID:bmunger,项目名称:mame,代码行数:58,代码来源:submenu.cpp
示例14: listenErrorCallback
OCStackApplicationResult listenErrorCallback(void* ctx, OCDoHandle /*handle*/,
OCClientResponse* clientResponse)
{
if (!ctx || !clientResponse)
{
return OC_STACK_KEEP_TRANSACTION;
}
ClientCallbackContext::ListenErrorContext* context =
static_cast<ClientCallbackContext::ListenErrorContext*>(ctx);
if (!context)
{
return OC_STACK_KEEP_TRANSACTION;
}
OCStackResult result = clientResponse->result;
if (result == OC_STACK_OK)
{
if (!clientResponse->payload || clientResponse->payload->type != PAYLOAD_TYPE_DISCOVERY)
{
oclog() << "listenCallback(): clientResponse payload was null or the wrong type"
<< std::flush;
return OC_STACK_KEEP_TRANSACTION;
}
auto clientWrapper = context->clientWrapper.lock();
if (!clientWrapper)
{
oclog() << "listenCallback(): failed to get a shared_ptr to the client wrapper"
<< std::flush;
return OC_STACK_KEEP_TRANSACTION;
}
ListenOCContainer container(clientWrapper, clientResponse->devAddr,
reinterpret_cast<OCDiscoveryPayload*>(clientResponse->payload));
// loop to ensure valid construction of all resources
for (auto resource : container.Resources())
{
std::thread exec(context->callback, resource);
exec.detach();
}
return OC_STACK_KEEP_TRANSACTION;
}
std::string resourceURI = clientResponse->resourceUri;
std::thread exec(context->errorCallback, resourceURI, result);
exec.detach();
return OC_STACK_DELETE_TRANSACTION;
}
开发者ID:alexgg,项目名称:iotivity,代码行数:50,代码来源:InProcClientWrapper.cpp
示例15: ui
void menu_selector::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
float width;
std::string tempbuf = std::string(_("Selection List - Search: ")).append(m_search).append("_");
// get the size of the text
ui().draw_text_full(container(), tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
float maxwidth = std::max(width, origx2 - origx1);
// compute our bounds
float x1 = 0.5f - 0.5f * maxwidth;
float x2 = x1 + maxwidth;
float y1 = origy1 - top;
float y2 = origy1 - UI_BOX_TB_BORDER;
// draw a box
ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_GREEN_COLOR);
// take off the borders
x1 += UI_BOX_LR_BORDER;
x2 -= UI_BOX_LR_BORDER;
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container(), tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
// bottom text
// get the text for 'UI Select'
std::string ui_select_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD));
tempbuf = string_format(_("Double click or press %1$s to select"), ui_select_text);
ui().draw_text_full(container(), tempbuf.c_str(), 0.0f, 0.0f, 1.0f, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NONE, rgb_t::white, rgb_t::black, &width, nullptr);
width += 2 * UI_BOX_LR_BORDER;
maxwidth = std::max(maxwidth, width);
// compute our bounds
x1 = 0.5f - 0.5f * maxwidth;
x2 = x1 + maxwidth;
y1 = origy2 + UI_BOX_TB_BORDER;
y2 = origy2 + bottom;
// draw a box
ui().draw_outlined_box(container(), x1, y1, x2, y2, UI_RED_COLOR);
// take off the borders
x1 += UI_BOX_LR_BORDER;
x2 -= UI_BOX_LR_BORDER;
y1 += UI_BOX_TB_BORDER;
// draw the text within it
ui().draw_text_full(container(), tempbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::NEVER,
mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
}
开发者ID:GiuseppeGorgoglione,项目名称:mame,代码行数:57,代码来源:selector.cpp
示例16: instanceForModelNode
void NodeInstanceView::auxiliaryDataChanged(const ModelNode &node, const PropertyName &name, const QVariant &data)
{
if ((node.isRootNode() && (name == "width" || name == "height")) || name.endsWith(PropertyName("@NodeInstance"))) {
if (hasInstanceForModelNode(node)) {
NodeInstance instance = instanceForModelNode(node);
QVariant value = data;
if (value.isValid()) {
PropertyValueContainer container(instance.instanceId(), name, value, TypeName());
ChangeAuxiliaryCommand changeAuxiliaryCommand(QVector<PropertyValueContainer>() << container);
nodeInstanceServer()->changeAuxiliaryValues(changeAuxiliaryCommand);
} else {
if (node.hasVariantProperty(name)) {
PropertyValueContainer container(instance.instanceId(), name, node.variantProperty(name).value(), TypeName());
ChangeValuesCommand changeValueCommand(QVector<PropertyValueContainer>() << container);
nodeInstanceServer()->changePropertyValues(changeValueCommand);
} else if (node.hasBindingProperty(name)) {
PropertyBindingContainer container(instance.instanceId(), name, node.bindingProperty(name).expression(), TypeName());
ChangeBindingsCommand changeValueCommand(QVector<PropertyBindingContainer>() << container);
nodeInstanceServer()->changePropertyBindings(changeValueCommand);
}
}
}
}
}
开发者ID:C-sjia,项目名称:qt-creator,代码行数:24,代码来源:nodeinstanceview.cpp
示例17: main
int main() {
std::vector<int> v;
v.push_back(5);
v.push_back(2);
v.push_back(9);
Circulator c( v.begin(), v.end());
Container container( c);
std::sort( container.begin(), container.end());
Iterator i = container.begin();
assert( *i == 2);
i++; assert( *i == 5);
i++; assert( *i == 9);
i++; assert( i == container.end());
return 0;
}
开发者ID:2php,项目名称:cgal,代码行数:15,代码来源:circulator_prog1.cpp
示例18: draw_density
static void draw_density ( void )
{
static Float x, y, d00, d01, d10, d11;
glBegin ( GL_QUADS );
for (int i=1 ; i<=NX ; i++ ) {
x = (i-0.5)*HH;
for (int j=1 ; j<=NY ; j++ ) {
y = (j-0.5)*HH;
d00 = container(i,j) > 0. ? 0. : 200;
d01 = container(i,j+1) > 0. ? 0. : 200;
d10 = container(i+1,j) > 0. ? 0. : 200;
d11 = container(i+1,j+1) > 0. ? 0. : 200;
glColor3f ( d00, d00, d00 ); glVertex2f ( x, y );
glColor3f ( d10, d10, d10 ); glVertex2f ( x+HH, y );
glColor3f ( d11, d11, d11 ); glVertex2f ( x+HH, y+HH );
glColor3f ( d01, d01, d01 ); glVertex2f ( x, y+HH );
}
}
glEnd ();
}
开发者ID:pizibing,项目名称:particlelevelsetlibrary,代码行数:24,代码来源:main.cpp
示例19: take
// Is the iterator positioned at the last element?
UtlBoolean UtlListIterator::atLast() const
{
UtlBoolean isAtLast = false;
UtlContainer::acquireIteratorConnectionLock();
OsLock take(const_cast<OsBSem&>(mContainerRefLock));
UtlList* myList = static_cast<UtlList*>(mpMyContainer);
OsLock container(myList->mContainerLock);
UtlContainer::releaseIteratorConnectionLock();
isAtLast = (mpCurrentNode && mpCurrentNode == myList->tail());
return isAtLast;
}
开发者ID:John-Chan,项目名称:sipXtapi,代码行数:16,代码来源:UtlListIterator.cpp
示例20: fatal
partContainer
HgammaHandler<partType, partContainer, auxContainer>::getStoreContainer(std::string name)
{
// Get shallow copy from TStore
partContainer *storeContainer = NULL;
if (m_store->retrieve(storeContainer, name).isFailure()) {
fatal("Cannot access container");
}
// Make the container from the TStore'd shallow copy
partContainer container(storeContainer->begin(),
storeContainer->end(),
SG::VIEW_ELEMENTS);
return container;
}
开发者ID:rjwang,项目名称:HGamAnalysisFramework,代码行数:15,代码来源:HgammaHandler.hpp
注:本文中的container函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论