Search Results

Search found 4034 results on 162 pages for 'ioc container'.

Page 21/162 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • What exactly is a "key container"?

    - by saugata
    Is it something specific, with a definite structure, or just an arbitrary data file with some form of encryption to hold keys, and potentially other secret information? Can someone please explain the term or point me to a link.

    Read the article

  • regarding C++ stl container swap function

    - by sm1
    I recently learned that all stl containers have swap function: i.e. c1.swap(c2); will lead to object underlying c1 being assigned to c2 and vice versa. I asked my professor if same is true in case of c1 and c2 being references. he said same mechanism is followed. I wonder how it happens since c++ references cannot be reseted.

    Read the article

  • Is there a concurrent container library for C++

    - by Lirik
    I'm looking for implementations of lock-free containers: Blocking Queue Blocking Stack Hash Map etc... Are there any good libraries out there? I would like to refrain from writing these data structures... I would much rather use something that has been tested by the community.

    Read the article

  • Multithreading with STL container

    - by Steven
    I have an unordered map which stores a pointer of objects. I am not sure whether I am doing the correct thing to maintain the thread safety. typedef std::unordered_map<string, classA*>MAP1; MAP1 map1; pthread_mutex_lock(&mutexA) if(map1.find(id) != map1.end()) { pthread_mutex_unlock(&mutexA); //already exist, not adding items } else { classA* obj1 = new classA; map1[id] = obj1; obj1->obtainMutex(); //Should I create a mutex for each object so that I could obtain mutex when I am going to update fields for obj1? pthread_mutex_unlock(&mutexA); //release mutex for unordered_map so that other threads could access other object obj1->field1 = 1; performOperation(obj1); //takes some time obj1->releaseMutex(); //release mutex after updating obj1 }

    Read the article

  • jQuery - get form elements by container id

    - by ungarida
    Which is the easiest way to get all form elements which are contained by a wrapper element. <form name="myForm"> <input name="elementA" /> <div id="wrapper"> <input name="elementB" /> <textarea name="elementC" /> </div> </form> In the above HTML I would elementB and elementC but not elementA. I do not want to list all form element types (select,textarea,input,option...). I would prefer to use myForm.elements. Any ideas?

    Read the article

  • castle windsor container not wiring properties correctly

    - by Damian
    I have a class that i want to instantiate thru castle in configuration. public class MyMappings : IMappings { Mapping FirstMapping { get; set; } Mapping SecondMapping { get; set; } OtherType ThirdMapping { get; set; } OtherType FourthMapping { get; set; } Mapping FifthMapping { get; set; } OtherType SixMapping { get; set; } } In my configuration i have the following: ${anothercomponentIDForCompomentOftypeMapping} The problem i am facing is that is assigning the same value to all properties of the same type, completly ignoring the name of the parameter. This properties are optional, i just want to initialize the value for one of them. Thanks,

    Read the article

  • C#; listbox's as one object(container)

    - by Oyeme
    Hello, I use Visual studio 2008 I have 5 listbox's on form,I created a new class file -called him "scaner.cs" scaner.cs -he cannot see "listbox". I have create an instance. scaner Comp = new scaner(listBox2, listBox1, listBox3, listBox4, listBox5); In scaner.cs file I use it like this. class scaner { public ListBox ls; public ListBox lsE; public ListBox lsIVars; public ListBox lsNumbers; public ListBox lsStrings; public scaner(ListBox ls, ListBox lsE, ListBox lsIVars, ListBox lsNumbers, ListBox lsStrings) { this.ls = ls; this.lsE = lsE; this.lsIVars = lsIVars; this.lsNumbers = lsNumbers; this.lsStrings = lsStrings; } } My question : How can i replaced this big code to more "comfortably" method. scaner Comp = new scaner(listBox2, listBox1, listBox3, listBox4, listBox5); IF i had more then 5 listbox's ,it will be awful. How can i acced form another class file "Listbox's" Thanks for answers.

    Read the article

  • Binding a TextBox's Width to its parent container's ActualWidth

    - by Praetorian
    Hi, I'm loading a Textbox and a Button into a horizontal StackPanel programmatically. The size of the button (which only contains an Image) is fixed, but I can't get the textbox to fill the available width of its parent. This is what the code looks like: StackPanel parent = new StackPanel() { Orientation = Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Top, }; TextBox textbox = new TextBox() { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Top, //MinWidth = 375, }; Button btn = new Button() { Content = new Image() { MaxHeight = 40, MaxWidth = 40, MinHeight = 40, MinWidth = 40, Margin = new Thickness( 0 ), Source = new BitmapImage( new Uri( "btnimage.png", UriKind.Relative ) ), }, HorizontalAlignment = HorizontalAlignment.Right, BorderBrush = new SolidColorBrush( Colors.Transparent ), Margin = new Thickness( 0 ), }; btn.Click += ( ( s, e ) => OnBtnClicked( s, e, textbox ) ); parent.Children.Add( textbox ); parent.Children.Add( btn ); If I uncomment the MinWidth setting for the textbox it is displayed as I want it to, but I'd like to not have to specify a width explicitly. I tried adding a binding as follows but that doesn't work at all (the textbox just disappears!) Binding widthBinding = new Binding() { Source = parent.ActualWidth, }; passwdBox.SetBinding( TextBox.WidthProperty, widthBinding ); Thanks for your help in advance!

    Read the article

  • Can't append to second container

    - by George Katsanos
    I have the following script: (function($) { $.fn.easyPaginate = function(options){ var defaults = { step: 4, delay: 100, numeric: true, nextprev: true, controls: 'pagination', current: 'current' }; var options = $.extend(defaults, options); var step = options.step; var lower, upper; var children = $(this).children(); var count = children.length; var obj, next, prev; var page = 1; var timeout; var clicked = false; function show(){ clearTimeout(timeout); lower = ((page-1) * step); upper = lower+step; $(children).each(function(i){ var child = $(this); child.hide(); if(i>=lower && i<upper){ setTimeout(function(){ child.fadeIn('fast') }, ( i-( Math.floor(i/step) * step) )*options.delay ); } if(options.nextprev){ if(upper >= count) { next.addClass('stop'); } else { next.removeClass('stop'); }; if(lower >= 1) { prev.removeClass('stop'); } else { prev.addClass('stop'); }; }; }); $('li','#'+ options.controls).removeClass(options.current); $('li[data-index="'+page+'"]','#'+ options.controls).addClass(options.current); if(options.auto){ if(options.clickstop && clicked){}else{ timeout = setTimeout(auto,options.pause); }; }; }; function auto(){ if(upper <= count){ page++; show(); } else { page--; show(); } }; this.each(function(){ obj = this; if(count>step){ var pages = Math.floor(count/step); if((count/step) > pages) pages++; var ol = $('<ol id="'+ options.controls +'" class="pagin"></ol>').insertAfter(obj); if(options.nextprev){ prev = $('<li class="prev">prev</li>') .appendTo(ol) .bind('click', function() { //check to see if there are any more pages in the negative direction if (page > 1) { clicked = true; page--; show(); } }); } if(options.numeric){ for(var i=1;i<=pages;i++){ $('<li data-index="'+ i +'">'+ i +'</li>') .appendTo(ol) .click(function(){ clicked = true; page = $(this).attr('data-index'); show(); }); }; }; if(options.nextprev){ next = $('<li class="next">next</li>') .appendTo(ol) .bind('click', function() { //check to see if there are any pages in the positive direction if (page < (count / 4)) { clicked = true; page++; show(); } }); } show(); }; }); }; })(jQuery); jQuery(function($){ $('ul.news').easyPaginate({step:4}); }); which is a carousel-like plugin that produces this html structure for the navigation: <ol id="pagination" class="pagin"><li class="prev">prev</li><li data-index="1" class="">1</li><li data-index="2" class="">2</li><li data-index="3" class="current">3</li><li class="next stop">next</li></ol> And all I want is to enclose this list in a div. Seems simple, but appendTo doesn't want to cooperate with me, or I'm doing something wrong (I'd appreciate if you would help me understand what that is..) So I'm modifying as such: var ol = $('<ol id="'+ options.controls +'" class="pagin"></ol>'); var tiv = $('<div id="lala"></div>'); ol.appendTo('#lala'); tiv.insertAfter(obj); I know how to chain, but I'm in "debugging" mode trying to understand why I don't get the result I imagine I would get: <div id="lala> <ol id="pagination><li>...... </li></ol> </div> I tried putting some console.log's to see the status of my variables but couldn't find something useful.. I guess there's something with DOM insertion I don't get.

    Read the article

  • Div not filling width of floated container (css expert needed

    - by Rayden
    I know there are many variations of this question posted, but none I've found quite provide an answer that works for this case. I basically have two left floated divs. Inside those two divs are div headers and tabled content. I want the Div headers (Hour/Minute) to stretch to the width of the tabled content, but they only do this in FF and Chrome, not IE7. IE7 is my works official browser so the one I need it to work with the most. Here is the CSS: #ui-timepicker-div { padding:0.2em; } #ui-timepicker-hours { float:left; } #ui-timepicker-minutes { margin:0 0 0 0.2em; float:left; } .ui-timepicker .ui-timepicker-header { padding:0.2em 0; } .ui-timepicker .ui-timepicker-title { line-height:1.8em; text-align:center; } .ui-timepicker table { margin:0.15em 0 0 0; font-size:.9em; border-collapse:collapse; } .ui-timepicker td { padding:1px; width:2.2em; } .ui-timepicker th, .ui-timepicker td { border:0; } .ui-timepicker td a { display:block; padding:0.2em 0.3em 0.2em 0.5em; text-align:right; text-decoration:none; } Here is the HTML (did not include tabled content): <div style="position: absolute; top: 252.667px; left: 648px; z-index: 1; display: none;" class="ui-timepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" id="ui-timepicker-div"> <div id="ui-timepicker-hours"> <div class="ui-timepicker-header ui-widget-header ui-helper-clearfix ui-corner-all"> <div class="ui-timepicker-title">Hour</div> </div> <table class="ui-timepicker"> </table> </div> <div id="ui-timepicker-minutes"> <div class="ui-timepicker-header ui-widget-header ui-helper-clearfix ui-corner-all"> <div class="ui-timepicker-title">Minutes</div> </div> <table class="ui-timepicker"> </table> </div> </div>

    Read the article

  • Modifying WPF listbox items container when using groupstyle

    - by rulestein
    I have a listbox that is grouping the items with a GroupStyle. I would like add a control at the bottom of the stackpanel that holds all of the groups. This additional control needs to be part of the scrolling content so that the user would scroll to the bottom of the list to see the control. If I were using a listbox without the groups, this task would be easy by modifying the ListBox template. However, with the items grouped, the ListBox template seems to only apply on a per group basis. I can modify the GroupStyle.Panel, but that doesn't allow me to add items to that panel. <----- I would like to add a control to this stackpanel

    Read the article

  • Hold border and Resize two or more DIV simultaneously in the same container

    - by Manu
    Code : <div id="widget1"> <div class="part blue">this is the part</div> <div class="part white">of the genial</div> <div class="part red">and good widget</div> </div> Let's say that div#widget1 is 99px width and div.part are 33px by default. How can I easily resize div.blue by increasing its width and deacreasing width of other div.part proportionnaly ? http://jqueryui.com/demos/resizable/#synchronous-resize : give an example which show element increase in the same time. Thanks,

    Read the article

  • jQuery ajax.load div, then have parent container access property

    - by Brett
    So I have a tabbed ui "form", each tab is quiet complicated so it is loaded via the .load('item.html'); command. All good, when the user clicks to a different tab, I want to read a property, maybe execute a function from within the ajax loaded div. What is the best way to get to these properties and methods from outsite the ajax loaded div?

    Read the article

  • Container<ImplementerOfIInterface> is not Container<IInterface>. Why not?

    - by Chris Simmons
    Why wouldn't DoesntWork() work below? The error is: Cannot implicitly convert type 'List' to 'IEnumerable'. An explicit conversion exists (are you missing a cast?). I know this is something about generic/templates I'm not getting, but List is IEnumerable and Implementer is an IInterface. I don't see why this needs to be casted (or if it really can be). public interface IInterface { // ... } public class Implementer : IInterface { // ... } IEnumerable<IInterface> DoesntWork() { List<Implementer> result = new List<Implementer>(); return result; }

    Read the article

  • Using an iterator without its container

    - by User1
    I am mixing some C and C++ libraries and have only a single pointer available to do some work in a callback function. All I need to do is iterate through a vector. Here's a simplified, untested example: bool call_back(void* data){ done=... if (!done) cout << *data++ << endl; return done; } Note that this function is in an extern "C" block in C++. call_back will be called until true is returned. I want it to cout the next element each time it's called. data is a pointer to something that I can pass from elsewhere in the code (an iterator in the above example, but can be anything). Something from data will likely be used to calculate done. I see two obvious options to give to data: Have data point to my vector. Have data point to an iterator of my vector. I can't use an iterator without having the .end() method available, right? I can't use a vector alone (unless maybe I start removing its data). I could make a struct with both vector and iterator, but is there a better way? What would you do?

    Read the article

  • Unknown Space between 2 Container Divs

    - by Paul
    Im trying to determine why there would be space between 2 Containing Divs as shown, and I would appreciate any insight as to why this is occurring: The unknown space occurs between the mid-feature div (olive) and bottom-wrap div (orange) I have no heights set anywhere. I would like to see the orange div up against the olive div just above it. I can post all of the CSS, or you can FireBug this: www.davincispainting.com Here is all of the CSS: *{ margin:0; padding:0 } body { /*background: url("/images/blueback5.jpg") repeat-x scroll 0 0 transparent;*/ background-color: #9EB0C8; font-family: Arial,Helvetica,sans-serif; font-size: 62.5%; } #top-wrap { height: 126px; width: 940px; /*background-color: Yellow;*/ margin: 5px 0 0 0; } #head-logo { background: url("/images/logo3.png") no-repeat scroll 0 0 transparent; /*background-color: Green;*/ height: 126px; width: 214px; margin: 0px 0 0 58px; position: absolute; z-index: 100; } #submenu1 { border: 0 solid #000000; color: #FFFFFF; /*background-color:Green;*/ font-family: Arial,Impact,Impact5,Charcoal6,sans-serif; font-size: 1.6em; height: 35px; width: 155px; /*padding: 10px 0 0;*/ margin: 7px 0 0 774px; position: absolute; } #submenu2 { /*border: 0 solid #000000;*/ color: #FFFFFF; /*background-color:Blue;*/ font-family: Arial,Impact,Impact5,Charcoal6,sans-serif; font-size: 1.8em; text-align: right; height: 20px; width: 114px; margin: 30px 0 0 818px; /*padding: 5px 0 0;*/ } a.contact { background-image: url("/images/RapidButton2.png"); /*border: 1px solid #CCCCCC;*/ /*clear: both;*/ /*color: #FFFFFF;*/ display: block; font-size: 11px; /*margin-bottom: 1px;*/ /*padding: 3px 5px;*/ text-align: center; width: 165px; height: 27px; } a.contact:hover { background-image: url("/images/RapidButtonHov2.png"); } #navigation-primary { margin: 12px 0 0 276px; position: absolute; } #global-wrap { margin: 0 auto; text-align: left; width: 880px; overflow: hidden; } #global-inner { background: url("/images/main_bg.gif") repeat-y scroll 0 0 #E4EAEF; font-family: Arial; font-size: 1.2em; margin: 15px 0 55px 0; overflow: hidden; text-align: left; width: 880px; } #global-inner .topleft { background: url("/images/main_left_top_corner2.jpg") no-repeat scroll left top transparent; float: left; height: 9px; width: 9px; } #global-inner .topright { background: url("/images/main_right_top_corner2.jpg") no-repeat scroll right top transparent; float: right; height: 9px; width: 9px; } #global-inner .bottomleft { background: url("/images/main_left_bottom_corner.jpg") no-repeat scroll left bottom transparent; float: left; height: 9px; margin-top: -8px; /*margin: 776px 0 0 0;*/ width: 9px; } #global-inner .bottomright { background: url("/images/main_right_bottom_corner.jpg") no-repeat scroll right bottom transparent; float: right; height: 9px; margin-top: -8px; /*margin: 776px 0 0 0;*/ width: 9px; } #top-feature { height:330px; width: 848px; margin: 12px 0 0 16px; background: #E4EAEF; /*background: orange;*/ /*padding: 10px 0 0 10px;*/ position: absolute; text-align: left; } .slideshow { height: 330px; width: 848px; margin: 0 0 0 0; /*background: blue;*/ position: absolute; } #mid-feature { margin:350px 0 0 16px; width:848px; height:318px; background-color:Olive; position:relative; overflow:hidden; } #mid-featureleft { height:318px; width:552px; /*background-color:Purple;*/ float:left; position:relative; } #mid-featureright { height:318px; width:296px; background-color:#B9C1CC; /*background-color: red;*/ float:left; position: relative; } #mid-featureleft h1 { color: #FF0000; font-family: Arial,Helvetica,sans-serif; font-size: 2.1em; } #mid-featureleft .contentbox { padding:7px 7px 7px 7px; } #mid-featureleft p { color: #0C2A55; margin:0px 0 11px 0px; /*font-style:normal;*/ /*width: 97%;*/ /*font-size: .5em;*/ font-size: 12px; } #bottom-wrap { height:60px; width: 868px; margin: auto 0 0 6px; background:orange; position: relative; } #copyright { float: left; /*background-color:Teal;*/ width: 260px; height: 60px; text-align: left; position: absolute; margin:0 0 0 6px; } #bottom-logos { height:60px; width:596px; margin:0 0 0 267px; background: url("/images/logos2.png") no-repeat scroll 0 0 transparent; /*background-color:red;*/ position:absolute; }

    Read the article

  • Container of Generic Types in java

    - by Cyker
    I have a generic class Foo<T> and parameterized types Foo<String> and Foo<Integer>. Now I want to put different parameterized types into a single ArrayList. What is the correct way of doing this? Candidate 1: public class MMM { public static void main(String[] args) { Foo<String> fooString = new Foo<String>(); Foo<Integer> fooInteger = new Foo<Integer>(); ArrayList<Foo<?> > list = new ArrayList<Foo<?> >(); list.add(fooString); list.add(fooInteger); for (Foo<?> foo : list) { // Do something on foo. } } } class Foo<T> {} Candidate 2: public class MMM { public static void main(String[] args) { Foo<String> fooString = new Foo<String>(); Foo<Integer> fooInteger = new Foo<Integer>(); ArrayList<Foo> list = new ArrayList<Foo>(); list.add(fooString); list.add(fooInteger); for (Foo foo : list) { // Do something on foo. } } } class Foo<T> {} In a word, it is related to the difference between Foo<?> and the raw type Foo. Update: Grep What is the difference between the unbounded wildcard parameterized type and the raw type? on this link may be helpful.

    Read the article

  • Use a table as container or not?

    - by Camran
    I have created my entire website by using a main table, and having the content inside the table. Some ppl suggest this is wrong, and I would like to know what to do specifically in my situation. On my index.html I have a <table align="center"> and then all content in it. Now the content is in form of DIVS and they all have relative positioning, so they are relative to the table. For example: <table align="center"> <tr> <td> <div style="position:relative; left:14px; top:50px;"> CONTENT HERE... (Form, divs, images) </div> </td> </tr> </table> I have just gotten to the stage of browser compatibility. Without making any changes whatsoever, my website works perfect in FF, SAFARI, Chrome and Opera. Only trouble with IE. So for my Q, if you where me, would you change my layout and remove the tables, and instead use alot more css and alot more DIVS, or would you go with what I have? And please if you answer me, don't just provide me with the answer, but also a "why" that is... in other words, give me arguments and facts... Thanks

    Read the article

  • Loop through children and display each, as3

    - by VideoDnd
    How do I loop through all of my children, and display each? I would like to know the best way to do this. my children and containerfive children, one plays every sec, 1,2,3, etc. var square1:Square1 = new Square1; var square2:Square2 = new Square2; var square3:Square3 = new Square3; var square4:Square4 = new Square4; var square5:Square5 = new Square5; var container:Sprite = new Sprite; addChild(container); container.addChild(square1) container.addChild(square2) container.addChild(square3) container.addChild(square4) container.addChild(square5) my timer var timly:Timer = new Timer(1000, 5); timly.start(); timly.addEventListener(TimerEvent.TIMER, onLoop); Note: Tried for loop, numChildren -1, and visibility ERROR 'access of undefined property' //Thomas's idea var timly:Timer = new Timer(1000, 10); timly.start(); timly.addEventListener(TimerEvent.TIMER, onLoop, false, 0, true); // var square1:Square1 = new Square1; square1.visible = false container.addChild(square2) var square2:Square2 = new Square2; square2.visible = false container.addChild(square3) var square3:Square3 = new Square3; square3.visible = false container.addChild(square3) var square4:Square4 = new Square4; square4.visible = false container.addChild(square4) var square5:Square5 = new Square5; square5.visible = false container.addChild(square5) var container:Sprite = new Sprite; this.addChild(container); var curCount:Number = 100; // function collectChildren(container:DisplayObjectContainer):Array { var len:int = container.numChildren; var mySquaresArray:Array = []; for (var i:int = 0; i < len; i++) { mySquaresArray.push(container.getChildAt(i).name); } return mySquaresArray; } // function onLoop( e:Event ) { curCount = e.target.currentCount; if( curCount > 1 ) { var previous_square = curCount -2; mySquaresArray[previous_square].visible = false; } var current_square = curCount - 1; mySquaresArray[current_square].visible = true; }

    Read the article

  • CompositionHost.Initialize() can not execute twice.

    - by Khoa
    I am currently try to integrate MEF and PRISM to work with each other. Everything is working fine so far. Now i would like to use MEF runtime module discovery (DeploymentCatalog) which will be used to download XAPs from server directory and then plug it into one of the Region inside my MAIN UI. I am using UnityBootStrapper and inside this class i also integrated MEF container. This sample application is based on Glenn Block (http://codebetter.com/glennblock/2010/01/03/mef-and-prism-exploration-mef-module-loading/). The following code is used to initialize CompositionContainer inside my Bootstrapper: // This is the host catalog which contains all parts of running assembly. var catalog = GetHostCatalog(); // Create MEF container which initial catalog var container = new CompositionContainer(catalog); // here we explicitly map a part to make it available on imports elsewhere, using // Unity to resolve the export so dependencies are resolved // We do this because region manager is third-party ... therefore, we need to // export explicitly because the implementation doesn't have its own [export] tag container.ComposeExportedValue<IRegionManager>(Container.Resolve<IRegionManager>()); container.ComposeExportedValue<IEventAggregator>(Container.Resolve<IEventAggregator>()); // Obtain CatalogService as a singleton // All dynamic modules will use this service to add its parts. Container.RegisterInstance<ICatalogService>(new CatalogService(catalog)); // Initialize the container CompositionHost.Initialize(container); Now i have another class called DeploymentCatalogService which is used to download the XAP from server. The current problem i am facing is that inside DeploymentCatalogService Initialize method, CompositionHost container is try to initialize its container with aggregateCatalog again. _aggregateCatalog = new AggregateCatalog(); _aggregateCatalog.Catalogs.Add(new DeploymentCatalog()); CompositionHost.Initialize(_aggregateCatalog); This causes an Exception which stated that The container has already been initialized. Is there a way to use the existing container and update it with the new aggregateCatalog? Hope this is not too confusing. Please be nice i am still new to MEF. Cheers,

    Read the article

  • Resolve dependency with autofac based on constructor parameter attribute

    - by Andrew Davey
    I'm using AutoFac. I want to inject a different implementation of a dependency based on an attribute I apply to the constructor parameter. For example: class CustomerRepository { public CustomerRepository([CustomerDB] IObjectContainer db) { ... } } class FooRepository { public FooRepository([FooDB] IObjectContainer db) { ... } } builder.Register(c => /* return different instance based on attribute on the parameter */) .As<IObjectContainer>(); The attributes will be providing data, such as a connection string, which I can use to instance the correct object. How can I do this?

    Read the article

  • MEF Property Export with PartCreationPolicy

    - by Daniel Skinner
    When I try to do this: [Export(typeof(IMyService))] [PartCreationPolicy(CreationPolicy.Shared)] private MyService Service { get { var service = new MyService(); service.Configure(); return service; } } I get a compile error: Attribute 'PartCreationPolicy' is not valid on this declaration type. It is only valid on 'class' declarations. Is this a bug? I don't see why MEF would allow property exports but not allow one to specify the part lifetime. Using VS2010 RC.

    Read the article

  • vector iterator not dereferencable at runtime on a vector<vector<vector<A*>*>*>

    - by marouanebj
    Hi, I have this destructor that create error at runtime "vector iterator not dereferencable". The gridMatrix is a std::vector<std::vector<std::vector<AtomsCell< Atom<T> * > * > * > * > I added the typename and also the typedef but I still have the error. I will move for this idea of vect of vect* of vect* to use boost::multi_array I think, but still I want to understand were this is wrong. /// @brief destructor ~AtomsGrid(void) { // free all the memory for all the pointers inside gridMatrix (all except the Atom<T>* ) //typedef typename ::value_type value_type; typedef std::vector<AtomsCell< Atom<T>* >*> std_vectorOfAtomsCell; typedef std::vector<std_vectorOfAtomsCell*> std_vectorOfVectorOfAtomsCell; std_vectorOfAtomsCell* vectorOfAtomsCell; std_vectorOfVectorOfAtomsCell* vectorOfVecOfAtomsCell; typename std_vectorOfVectorOfAtomsCell::iterator itSecond; typename std_vectorOfVectorOfAtomsCell::reverse_iterator reverseItSecond; typename std::vector<std_vectorOfVectorOfAtomsCell*>::iterator itFirst; //typename std::vector<AtomsCell< Atom<T>* >*>* vectorOfAtomsCell; //typename std::vector<std::vector<AtomsCell< Atom<T>* >*>*>* vectorOfVecOfAtomsCell; //typename std::vector<std::vector<AtomsCell< Atom<T>* >*>*>::iterator itSecond; //typename std::vector<std::vector<AtomsCell< Atom<T>* >*>*>::reverse_iterator reverseItSecond; //typename std::vector<std::vector<std::vector<AtomsCell< Atom<T>* >*>*>*>::iterator itFirst; for (itFirst = gridMatrix.begin(); itFirst != gridMatrix.end(); ++itFirst) { vectorOfVecOfAtomsCell = (*itFirst); while (!vectorOfVecOfAtomsCell->empty()) { reverseItSecond = vectorOfVecOfAtomsCell->rbegin(); itSecond = vectorOfVecOfAtomsCell->rbegin().base(); vectorOfAtomsCell = (*itSecond); // ERROR during run: "vector iterator not dereferencable" // I think the ERROR is because I need some typedef typename or template ???!!! // the error seems here event at itFirst //fr_Myit_Utils::vectorElementDeleter(*vectorOfAtomsCell); //vectorOfVecOfAtomsCell->pop_back(); } } fr_Myit_Utils::vectorElementDeleter(gridMatrix); } If someone want the full code that create the error I'm happy to give it but I do not think we can attach file in the forum. BUT still its is not very big so if you want it I can copy past it here. Thanks

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >