Sponsored Content
Top Forums Programming Separating template implementation from declaration Post 302769707 by kristinu on Wednesday 13th of February 2013 06:06:31 AM
Old 02-13-2013
There is another question. I have a class called Layer separated in 3 files

layer.hpp declaration
layer.ipp template implementations and inline functions
layer.cpp all remaining implementations

My question is what include files need I put in ipp and cpp.
Currently this is what I have.

Code:
// layer.hpp

#ifndef LAYER_HPP
#define LAYER_HPP

#include <assert.h>
#include <stdarg.h>

#include "tomso/optparse/parsing.hpp"
#include "tomso/string/string.hpp"
#include "tomso/linear_algebra/vect2.hpp"
#include "tomso/linear_algebra/gauss_elim.hpp"
#include "tomso/raytrace/layint_linear.hpp"
#include "tomso/raytrace/layint_spline.hpp"
#include "tomso/raytrace/layint_trigon.hpp"

enum TWave {
  PWave,
  SWave
};

class Layer {

  protected:

    Vect2  Xi;        // Top left corner of sound speed model
    Vect2  Xf;        // Bottom right corner of sound speed model
    float  VSVP;    
    bool  PS;
    ...


Code:
// layer.ipp

#include <assert.h>
#include <stdarg.h>

#include "tomso/optparse/parsing.hpp"
#include "tomso/string/string.hpp"
#include "tomso/linear_algebra/vect2.hpp"
#include "tomso/linear_algebra/gauss_elim.hpp"
#include "tomso/raytrace/layint_linear.hpp"
#include "tomso/raytrace/layint_spline.hpp"
#include "tomso/raytrace/laymod_trigon.hpp"

inline Layer::Layer (
  const Vect2&  xi,
  const Vect2&  xf
) {

  Xi = xi;
  Xf = xf;
  VSVP = DefVSVP;
  PS = false;
  Int = NULL;

}

Code:
// layer.cpp

#include "tomso/raytrace/layer.hpp"

Layer::~Layer (
) {

  if (Int != NULL) {
    delete Int;
  }
  if (ModP != NULL) {
    delete ModP;
  }
  if (ModS != NULL) {
    delete ModS;
  }

}


Last edited by kristinu; 02-13-2013 at 07:43 AM..
 

10 More Discussions You Might Find Interesting

1. Programming

Variable declaration

what does this mean when a variable is declared as register int i; Thanks. :confused: (2 Replies)
Discussion started by: laila63
2 Replies

2. Programming

separating commands

hey there well i have a small problem with my code. when for example : " /bin/sleep 10 & ls -l mila > xyz " is entered, the program is supposed to separate the two commands 1) /bin/sleep 10 & and 2) ls -l mila > xyz. im not sure of how to achieve this. my current program stores both commands... (2 Replies)
Discussion started by: mile1982
2 Replies

3. Shell Programming and Scripting

separating fields

Hi, i have a file as follows: jonathan:bonus1,bonus2 gerald:bonus1 patrick:bonus1,bonus2 My desired output is jonathan:bonus1 jonathan:bonus2 gerald:bonus1 patrick:bonus1 patrick:bonus2 my current code is cat $F | awk -F"" how should i continue the code? Can i do something... (5 Replies)
Discussion started by: new2ss
5 Replies

4. Shell Programming and Scripting

Help with variable declaration

I declared a variable x that gets the count(*) from a table. The table name is also defined as a variable. What's wrong with this statment : X=” select count(*) from ${table_name}“ then y = `${X}${table_name}' echo ${y} It throws an error saying count not found. Please... (1 Reply)
Discussion started by: dsravan
1 Replies

5. Shell Programming and Scripting

variable declaration

Hi Guys, What does this mean actually ? Can somebody give me any explanation ? x=${x:=1} Thanks (2 Replies)
Discussion started by: amit.behera
2 Replies

6. Shell Programming and Scripting

Separating fields

Hi, I have a text file in following format: 2.45 5.67 6.43 I have to cut the values before decimal and store them in a file. So the output file should look like: 2 5 6 . . and so on... Can someone suggest me a sed/awk command for doing this? (2 Replies)
Discussion started by: sajal.bhatia
2 Replies

7. Shell Programming and Scripting

separating folders

I have folder like main. inside main folder there are subfolders & files like main1 main2 main3, file1, file2, file3. I want folders main1 & main2, file1, file2 from main folder. copy them into new folder. Please suggest me how to do it. I am new to shell programming (2 Replies)
Discussion started by: ypremcha
2 Replies

8. Programming

DIR declaration

are you suppose to only use one DIR declarations, for example DIR *dir_ptr; because I'm declaring mine like so: DIR *dir_ptr_src, *dir_ptr_dest; and using it like so: if( ( dir_ptr_src = opendir ( av ) ) != NULL && ( dir_ptr_dest = opendir( av ) ) != NULL ) /* check if... (3 Replies)
Discussion started by: l flipboi l
3 Replies

9. Shell Programming and Scripting

variable declaration

how to check 1. If variable is declared or not 2. If any value if assigned to variable or not. in UNIX shell script (6 Replies)
Discussion started by: ace_friends22
6 Replies

10. Shell Programming and Scripting

awk RS declaration with \n

Hello Team, input text:... (7 Replies)
Discussion started by: chandana.hs
7 Replies
__gnu_pbds::detail::left_child_next_sibling_heap_nod__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >(3)

NAME
__gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc > - SYNOPSIS
Inherited by __gnu_pbds::detail::left_child_next_sibling_heap_const_iterator_< Node, _Alloc >. Public Types typedef _Alloc::template rebind< value_type > ::other::const_pointer const_pointer" typedef _Alloc::template rebind< value_type > ::other::const_reference const_reference" typedef trivial_iterator_difference_type difference_type" typedef trivial_iterator_tag iterator_category typedef _Alloc::template rebind< value_type > ::other::pointer pointer" typedef _Alloc::template rebind< value_type > ::other::reference reference" typedef Node::value_type value_type Public Member Functions left_child_next_sibling_heap_node_point_const_iterator_ (node_pointer p_nd) left_child_next_sibling_heap_node_point_const_iterator_ () left_child_next_sibling_heap_node_point_const_iterator_ (const left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc > &other) bool operator!= (const left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc > &other) const const_reference operator* () const const_pointer operator-> () const bool operator== (const left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc > &other) const Public Attributes node_pointer m_p_nd Protected Types typedef _Alloc::template rebind< Node >::other::pointer node_pointer" Detailed Description template<typename Node, typename _Alloc>class __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc > Const point-type iterator. Definition at line 61 of file left_child_next_sibling_heap_/point_const_iterator.hpp. Member Typedef Documentation template<typename Node , typename _Alloc > typedef _Alloc::template rebind< value_type>::other::const_pointer __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::const_pointer Iterator's const pointer type. Definition at line 86 of file left_child_next_sibling_heap_/point_const_iterator.hpp. template<typename Node , typename _Alloc > typedef _Alloc::template rebind< value_type>::other::const_reference __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::const_reference Iterator's const reference type. Definition at line 98 of file left_child_next_sibling_heap_/point_const_iterator.hpp. template<typename Node , typename _Alloc > typedef trivial_iterator_difference_type __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::difference_type Difference type. Definition at line 71 of file left_child_next_sibling_heap_/point_const_iterator.hpp. template<typename Node , typename _Alloc > typedef trivial_iterator_tag __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::iterator_category Category. Definition at line 68 of file left_child_next_sibling_heap_/point_const_iterator.hpp. template<typename Node , typename _Alloc > typedef _Alloc::template rebind< value_type>::other::pointer __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::pointer Iterator's pointer type. Definition at line 80 of file left_child_next_sibling_heap_/point_const_iterator.hpp. template<typename Node , typename _Alloc > typedef _Alloc::template rebind< value_type>::other::reference __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::reference Iterator's reference type. Definition at line 92 of file left_child_next_sibling_heap_/point_const_iterator.hpp. template<typename Node , typename _Alloc > typedef Node::value_type __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::value_type Iterator's value type. Definition at line 74 of file left_child_next_sibling_heap_/point_const_iterator.hpp. Constructor &; Destructor Documentation template<typename Node , typename _Alloc > __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::left_child_next_sibling_heap_node_point_const_iterator_ () [inline] Default constructor. Definition at line 106 of file left_child_next_sibling_heap_/point_const_iterator.hpp. template<typename Node , typename _Alloc > __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::left_child_next_sibling_heap_node_point_const_iterator_ (const left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc > &other) [inline] Copy constructor. Definition at line 111 of file left_child_next_sibling_heap_/point_const_iterator.hpp. Member Function Documentation template<typename Node , typename _Alloc > bool __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::operator!= (const left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc > &other) const [inline] Compares content (negatively) to a different iterator object. Definition at line 137 of file left_child_next_sibling_heap_/point_const_iterator.hpp. template<typename Node , typename _Alloc > const_reference __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::operator* () const [inline] Access. Definition at line 124 of file left_child_next_sibling_heap_/point_const_iterator.hpp. template<typename Node , typename _Alloc > const_pointer __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::operator-> () const [inline] Access. Definition at line 116 of file left_child_next_sibling_heap_/point_const_iterator.hpp. template<typename Node , typename _Alloc > bool __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >::operator== (const left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc > &other) const [inline] Compares content to a different iterator object. Definition at line 132 of file left_child_next_sibling_heap_/point_const_iterator.hpp. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ __gnu_pbds::detail::left_child_next_sibling_heap_node_point_const_iterator_< Node, _Alloc >(3)
All times are GMT -4. The time now is 01:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy