PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.cplus > design question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
design question

Réponse
 
LinkBack Outils de la discussion
Vieux 03/06/2008, 11h48   #1
Chris Forone
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut design question

hello group,

whats a good design for a loader of different grafic-files. have the
loader-class (fstream) and a texture-class (internal format/RGBA, always
the same). now i want different grafic-files (.bmp, .pcx, other very
simple gfx) loaded for the texture-class.

is there a "filter" design approach?
should i give some functor object for each gfx-format, that acts on the
pic-data?
is it best done via a class hirarchy?

thanks a lot & hand, chris
  Réponse avec citation
Vieux 03/06/2008, 13h20   #2
Victor Bazarov
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: design question

Chris Forone wrote:
> whats a good design for a loader of different grafic-files. have the
> loader-class (fstream) and a texture-class (internal format/RGBA, always
> the same). now i want different grafic-files (.bmp, .pcx, other very
> simple gfx) loaded for the texture-class.
>
> is there a "filter" design approach?


There probably is.

> should i give some functor object for each gfx-format, that acts on the
> pic-data?
> is it best done via a class hirarchy?


This looks like a good fit for the 'comp.software.patterns' or the
'comp.programming' newsgroup, or even 'comp.object'. I couldn't find
anything specific for C++ in your inquiry. Admittedly, you have the
word "functor" there, which is somewhat specific to the language feature
related to overloading of the operator(), but I don't yet see the point
of using operator() there. I can just as well be a member function
(method). I don't insist you post to those newsgroups, just consider it.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
  Réponse avec citation
Vieux 03/06/2008, 13h38   #3
Chris Forone
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: design question

Victor Bazarov schrieb:
> Chris Forone wrote:
>> whats a good design for a loader of different grafic-files. have the
>> loader-class (fstream) and a texture-class (internal format/RGBA,
>> always the same). now i want different grafic-files (.bmp, .pcx, other
>> very simple gfx) loaded for the texture-class.
>>
>> is there a "filter" design approach?

>
> There probably is.
>
>> should i give some functor object for each gfx-format, that acts on
>> the pic-data?
>> is it best done via a class hirarchy?

>
> This looks like a good fit for the 'comp.software.patterns' or the
> 'comp.programming' newsgroup, or even 'comp.object'. I couldn't find
> anything specific for C++ in your inquiry. Admittedly, you have the
> word "functor" there, which is somewhat specific to the language feature
> related to overloading of the operator(), but I don't yet see the point
> of using operator() there. I can just as well be a member function
> (method). I don't insist you post to those newsgroups, just consider it.
>
> V


Thanx, chris
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h13.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09259 seconds with 11 queries