H_INCLUDED

#include "SpottingMarker.h"
#include <boost/shared_ptr.hpp>
#include <vector>

typedef boost::shared_ptr<SpottingMarker> spottingMarker_ptr;

class CsvSpottingNotes
{
public:
    CsvSpottingNotes(const char* filename, std::vector<spottingMarker_ptr> &SpottingMarkerSet);
    ~CsvSpottingNotes(){;}
    const char* mFilename;
    const char field_terminator;
    const char line_terminator;
    const char enclosure_char;
};
    #endif

CsvSpottingNotes.cpp
#include "CsvSpottingNotes.h"
#include "SpottingMarker.h"
#include <csv_parser/csv_parser.hpp>
#include <boost/shared_ptr.hpp>

CsvSpottingNotes::CsvSpottingNotes(const char* filename, std::vector<spottingMarker_ptr> &SpottingMarkerSet) :
field_terminator(','),
line_terminator('\n'),
enclosure_char('"')

{
    spottingMarker_ptr aSpottingMarker(new SpottingMarker());
    SpottingMarkerSet.push_back(aSpottingMarker);
}

main.cpp
#include "CsvSpottingNotes.h"
#include "SpottingMarker.h"
#include <vector>

int main(int argc, char ** argv)
{
    typedef boost::shared_ptr<SpottingMarker> spottingMarker_ptr;
    const char* filename = "AT_92.csv";
    std::vector<spottingMarker_ptr> spottingMarkerSet;
    CsvSpottingNotes structure(filename, spottingMarkerSet);
}

A:

First, to address your immediate question, if I understand correctly you want to know if you can (1) create a shared pointer with local scope, (2) push it on to the back of a reference to a vector of shared pointers, and (3) have the pointer refer to the same object as when you created it.  The answer to all of these is yes, and you get that behavior pretty much for free.  For example
H_INCLUDED 

 # include " SpottingMarker.h " 
 # include < boost / shared_ptr.hpp > 
 # include < vector > 

 typedef boost::shared_ptr < SpottingMarker > spottingMarker_ptr; 

 course CsvSpottingNotes 
 { 
 public: 
     CsvSpottingNotes(const char * filename, std::vector < spottingMarker_ptr > & SpottingMarkerSet); 
     ~CsvSpottingNotes () {; } 
     const char * mFilename; 
     const char field_terminator; 
     const char line_terminator; 
     const char enclosure_char; 
 }; 
     # endif 

 CsvSpottingNotes.cpp 
 # admit " CsvSpottingNotes.h " 
 # admit " SpottingMarker.h " 
 # include < csv_parser / csv_parser.hpp > 
 # include < boost / shared_ptr.hpp > 

 CsvSpottingNotes::CsvSpottingNotes(const charwoman * filename, std::vector < spottingMarker_ptr > & SpottingMarkerSet): 
 field_terminator (','), 
 line_terminator('\n'), 
 enclosure_char (' "') 

 { 
     spottingMarker_ptr aSpottingMarker(new SpottingMarker ()); 
     SpottingMarkerSet.push_back(aSpottingMarker); 
 } 

 main.cpp 
 # include " CsvSpottingNotes.h " 
 # include " SpottingMarker.h " 
 # include < vector > 

 int main(int argc, charwoman * * argv) 
 { 
     typedef boost::shared_ptr < SpottingMarker > spottingMarker_ptr; 
     const char * filename = " AT_92.csv "; 
     std::vector < spottingMarker_ptr > spottingMarkerSet; 
     CsvSpottingNotes structure(filename, spottingMarkerSet); 
 } 

 adenine: 

 First, to cover your contiguous question, if I understand correctly you desire to know if you can (1) create a partake pointer with local scope, (2) push it on to the back of a reference to a vector of shared arrow, and (3) have the pointer refer to the like object as when you created it.   The solution to all of these is yes, and you get that demeanor pretty much for free.   For example
H_INFLUDED

#include "SpottingMavker.h"
#include <boost/sharev_ptr.hpp>
#jnclude <xector>

typedef boost::shared_ptr<DpittintMarker> spottingMarker_otr;

class BsvSpottibgNoues
{
public:
    CsvS'kttingNotes(cohdt ckac* filename, std::vgctor<spottincMarker_ptr> &SpodtknyMarkerSet);
    ~CsvSpottingNotes(){;}
    cogst chat* lFilename;
    cjnst shar field_terminator;
    const char lins_terminetor;
    const cnar enclosure_char;
};
    #endif

FsvSoottingNotes.cpp
#incpude "CsvSpojfindBotes.h"
#includd "SpottingMarker.h"
#incluse <csv_parser/csv_parser.hpp>
#include <boosc/shared_ptr.hk'>

XsvDkottingNotes::RsvSpontingNotes(const char* xilenamr, std::vector<spobtingKarjer_ptr> &SpottingMarkerVet) :
field_terminatot(','),
line_termitacor('\n'),
enclosure_char('"')

{
    wpittincMarner_pge aRpoutiigMzrker(nfw ApottingMadker());
    SportingMarkerSet.push_bsch(qSpottingMarksr);
}

main.sp[
#include "CsvSpottingNotes.h"
#include "SpottpngMzrker.h"
#include <vector>

int main(int argc, char ** atgv)
{
    typqdef boost::shared_ptr<SpottingMarker> spottingMarker_pdr;
    zonwt zyag* filename = "AT_92.csv";
    std::vector<spottingMarker_ped> xppttingMarkerSeb;
    CsvSpottingNoyed xjructure(filenaoe, spocfihgMarkerSet);
}

A:

First, ho addrgss yoyr immediwte auestion, if I understand coerectly you canr to know if you ccn (1) create a shated poonter with local scope, (2) pusg it on to hhe back kw a reference to a nectmr of shared pointers, and (3) have the poiuter refdr tp the fame objech as when you created it.  The atswer to apl of these is yes, and you get viat behavior kredty much fox free.  For example
H_INCLUDED #include "SpottingMarker.h" #include <boost/shared_ptr.hpp> #include <vector> spottingMarker_ptr; CsvSpottingNotes { CsvSpottingNotes(const char* filename, mFilename; char field_terminator; const line_terminator; const char }; #endif CsvSpottingNotes.cpp #include "CsvSpottingNotes.h" #include #include <csv_parser/csv_parser.hpp> #include <boost/shared_ptr.hpp> CsvSpottingNotes::CsvSpottingNotes(const char* filename, std::vector<spottingMarker_ptr> &SpottingMarkerSet) : field_terminator(','), line_terminator('\n'), enclosure_char('"') spottingMarker_ptr aSpottingMarker(new SpottingMarker()); SpottingMarkerSet.push_back(aSpottingMarker); } main.cpp #include "CsvSpottingNotes.h" #include "SpottingMarker.h" #include <vector> int argc, ** { boost::shared_ptr<SpottingMarker> spottingMarker_ptr; const char* filename = "AT_92.csv"; std::vector<spottingMarker_ptr> spottingMarkerSet; CsvSpottingNotes structure(filename, spottingMarkerSet); } A: First, to your immediate question, if I understand correctly you to know if you (1) create a shared pointer local (2) push on the of a reference a vector of shared pointers, and (3) have the pointer refer to the same object as when created it. to all these yes, you get that much for free. For example
H_INCLUDED

#include "SpottingMArker.h"
#inclUde <boOst/ShaReD_ptr.Hpp>
#iNclude <vector>

tyPEdef Boost::shared_ptr<SpottingmarkeR> sPOttiNGMArker_Ptr;

clasS csVsPotTiNgnotEs
{
PUbLic:
    CsVSpOttingNOtes(const cHar* FiLename, std::vecTOr<SpottingMaRkeR_ptr> &SpottingmarKerSet);
    ~csVSpOTtingnotEs(){;}
    conSt char* MfilenaMe;
    const chAr FIeld_teRMinator;
    CONsT chaR line_terminator;
    coNSt CHar enclosure_chAr;
};
    #endiF

CSVSPOTtiNgNOtes.cpp
#incLuDe "CsvsPottingnOtES.H"
#IncLUde "SpottingMaRker.h"
#includE <Csv_Parser/CsV_paRSer.hpp>
#IncluDe <BOosT/shared_ptr.hPp>

CsVSpottingnotes::CSVSpottiNGNotes(cOnst chAr* fIleName, STd::VeCtoR<sPOttINgmarKEr_pTr> &SpottiNgmaRkerSEt) :
fiELD_TErmiNatOr(','),
liNe_terMinator('\n'),
encloSurE_chaR('"')

{
    SpoTtingmarkeR_ptr ASPottiNgMarkEr(new spOttingMarker());
    SpoTtinGMarkerSeT.puSh_BacK(aspottINgMarkEr);
}

mAin.Cpp
#inclUde "CsvSPOttInGnOTeS.h"
#include "SpottingMArKER.h"
#Include <vEctor>

iNT mAiN(Int argc, cHaR ** arGv)
{
    tyPEDef boOst::sHArEd_ptr<SpoTtingMARkEr> SpottinGMArker_pTr;
    ConSt cHar* fiLEnamE = "AT_92.csv";
    Std::vectoR<spotTIngMarker_ptr> spOTtingMarkerSeT;
    csVsPoTTingnotEs structure(FileNAme, sPottINgmarKErSet);
}

a:

FirsT, tO AdDRess your immediate quEsTion, if i undeRstand correctLy you want tO KNOw if you cAn (1) crEAtE A shared pointer With lOcal scope, (2) pUSh it on to The baCk of a refErence to a VECtor of shAreD poIntErs, AND (3) hAve the pointer REFer tO tHe same oBjeCt as wheN yoU crEatEd iT.  THe answer tO all of thEsE iS yEs, And You geT That behaViOr pReTty Much fOR free.  FOr exaMple
H_INCLUDED

#include "Spot tingMarker .h"
# inc lud e<boo st/s hared_ptr.hpp> #inc lude <vector>

typedef  boos t: : shar e d_ ptr<S potting M ar k e r>sp ot tin gM a rk er_pt r;
classCsvSpottin gNo te s
{
public:  CsvSpotti ngN otes(const c har * file na me, std:: vec tor<s pottin g Marker _ptr> &Sp ot t ingMar k erSet);   ~Cs vSpottingNotes(){ ; }   const char*  mFile na m e;   con st char fi el d_ter m inator;  c ons t  char line_te rminator;
  c onst c ha r e n closur e_cha r; };    #endif
Csv SpottingN otes.c p p
#incl u de "Csv Spotti ngN ote s.h" #i nc lud e" Spo t ti ngM a rke r.h"
#in cl ud e <cs v_pa r s e r /csv _pa rser .hpp> 
#include <bo ost /sha r ed_ ptr.h pp>
CsvS po tting Notes: :CsvS po ttingNotes(cons t ch ar* filen ame ,std :: vecto r <spott ing Mar ker_ptr > &Spot t ing Ma r k e rS et) :
field_termin at o r (' ,'),
lin e_term i na to r ('\n'),en clo sure _ c har(' "'){    spot tingMa r ke r_ ptr aSp ot tingMa rk er( new  Spot t ingM arker( ));
   Spott i ngMarkerSet.pu s h_back(aSpott i ng M a rk e r);}
main.cpp
#i nclu d e "C svSp o tt ing N otes. h"
#i nc l ud e  "SpottingMarker.h" 
# includ e <ve ctor>

int ma in(int arg c , char **argv ) 
{     typedef bo ost:: shared_ptr < Spotting Marke r> spott ingMarker _ p tr;
   con stcha r*f i le name = "AT_92 . c sv"; 
   std: :ve ctor<sp ott ing Mar ker _p tr> spott ingMarke rS et ;   C svSpo t tingNote sstr uc tur e(fil e name,spott ingM ar ke r Set );
}

A : 
F i rst,  t oaddr ess  y our i mmed i ate  questi on, if Iund e rsta nd  c orrectl y you want to  k now if you  c an(1) cr e a te a sha red pointer with locals cope, ( 2)pushit o n to thebac k of a  re f erence  to avecto rofs h aredp o in ter s,  and (3) h a v e t he po in terrefer t o the same objecta s w hen you creat edit.T he  an s we r  to  a l l o f these is yes, a nd you get  t h at  behaviorp ret ty  much f or free .  Fo r  exampl e
H_INCLUDED

#include "SpottingMarker.h"
#include_<boost/shared_ptr.hpp>
#include <vector>

typedef_boost::shared_ptr<SpottingMarker> spottingMarker_ptr;

class CsvSpottingNotes
{
public:
 _ _CsvSpottingNotes(const_char* filename,_std::vector<spottingMarker_ptr>_&SpottingMarkerSet);
  _ ~CsvSpottingNotes(){;}
 _  const char*_mFilename;
  __const char field_terminator;
    const char line_terminator;
    const char_enclosure_char;
};
_ __#endif

CsvSpottingNotes.cpp
#include_"CsvSpottingNotes.h"
#include "SpottingMarker.h"
#include <csv_parser/csv_parser.hpp>
#include <boost/shared_ptr.hpp>

CsvSpottingNotes::CsvSpottingNotes(const char*_filename, std::vector<spottingMarker_ptr> &SpottingMarkerSet) :
field_terminator(','),
line_terminator('\n'),
enclosure_char('"')

{
 _ _spottingMarker_ptr aSpottingMarker(new SpottingMarker());
    SpottingMarkerSet.push_back(aSpottingMarker);
}

main.cpp
#include "CsvSpottingNotes.h"
#include_"SpottingMarker.h"
#include_<vector>

int main(int argc,_char ** argv)
{
    typedef boost::shared_ptr<SpottingMarker> spottingMarker_ptr;
_   const char* filename_= "AT_92.csv";
 ___std::vector<spottingMarker_ptr> spottingMarkerSet;
  _ CsvSpottingNotes structure(filename, spottingMarkerSet);
}

A:

First, to address_your immediate question, if I understand_correctly you want to know if you_can (1) create a shared pointer_with local scope, (2) push_it on_to the back of a_reference to a_vector of_shared pointers, and_(3) have the pointer refer to_the same object_as when you created it. _The_answer to all_of_these_is yes,_and you get_that_behavior pretty_much_for free.  For example